Skip to content

Commit efcca00

Browse files
committed
batchspawner/CondorSpawner: Allow to disable connect_to_job_cmd.
If connect_to_job_cmd is explcitly set to an empty string, CondorSpawner will not override the hostname with localhost, allowing to revert to the old behaviour (assuming direct connectivity).
1 parent e45200c commit efcca00

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

batchspawner/batchspawner.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,11 @@ def cmd_formatted_for_batch(self):
928928
return super(CondorSpawner,self).cmd_formatted_for_batch().replace('"','""').replace("'","''")
929929

930930
def state_gethost(self):
931-
"""This always returns localhost since connect_to_job forwards the singleuser server port from the spawned job"""
932-
return "localhost"
931+
"""Returns localhost if connect_to_job is used, as this forwards the singleuser server port from the spawned job"""
932+
if self.connect_to_job_cmd:
933+
return "localhost"
934+
else:
935+
return super(CondorSpawner,self).state_gethost()
933936

934937
class LsfSpawner(BatchSpawnerBase):
935938
'''A Spawner that uses IBM's Platform Load Sharing Facility (LSF) to launch notebooks.'''

0 commit comments

Comments
 (0)