Skip to content

Commit e45200c

Browse files
committed
BatchSpawnerBase: Replace {host} with self.ip in connect_to_job_cmd.
For implementations other than condor_ssh_to_job, it might be useful to use the hostname on which the notebook was spawned to proxy it.
1 parent 46b153d commit e45200c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

batchspawner/batchspawner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def _req_keepvars_default(self):
175175
connect_to_job_cmd = Unicode('',
176176
help="Command to connect to running batch job and forward the port "
177177
"of the running notebook to the Hub. If empty, direct connectivity is assumed. "
178-
"Uses self.job_id as {job_id} and the self.port as {port}."
178+
"Uses self.job_id as {job_id}, self.port as {port} and self.ip as {host}."
179179
"If {rport} is used in this string, it is set to self.port, "
180180
"and a new random self.port is chosen locally and used as {port}."
181181
"This is useful e.g. for SSH port forwarding."
@@ -221,6 +221,7 @@ async def connect_to_job(self):
221221
a new random self.port is chosen locally (useful e.g. for SSH port forwarding).
222222
"""
223223
subvars = self.get_req_subvars()
224+
subvars['host'] = self.ip
224225
subvars['job_id'] = self.job_id
225226
if '{rport}' in self.connect_to_job_cmd:
226227
self.rport = self.port

0 commit comments

Comments
 (0)