@@ -741,7 +741,7 @@ def clone_task(state, project_id=None):
741741 return task
742742
743743
744- def wait_for_machine (state , task ):
744+ def wait_for_machine (state , task , only_wait_for_ssh = False ):
745745 # wait until task is running
746746 print ('Waiting for remote machine allocation [id={}]' .format (task .id ))
747747 last_status = None
@@ -781,9 +781,9 @@ def wait_for_machine(state, task):
781781 state ['vscode_server' ] = vscode_server .strip ().lower () != 'false'
782782
783783 wait_properties = ['properties/internal_ssh_port' ]
784- if state .get ('jupyter_lab' ):
784+ if state .get ('jupyter_lab' ) and not only_wait_for_ssh :
785785 wait_properties += ['properties/jupyter_port' ]
786- if state .get ('vscode_server' ):
786+ if state .get ('vscode_server' ) and not only_wait_for_ssh :
787787 wait_properties += ['properties/vscode_port' ]
788788
789789 last_lines = []
@@ -1467,6 +1467,7 @@ def cli():
14671467 task = _get_previous_session (client , args , state , task_id = args .attach )
14681468
14691469 delete_old_tasks_callback = None
1470+ only_wait_for_ssh = False
14701471
14711472 if task :
14721473 state ['task_id' ] = task .id
@@ -1475,6 +1476,7 @@ def cli():
14751476 state ['username' ] = args .username
14761477 if args .password :
14771478 state ['password' ] = args .password
1479+ only_wait_for_ssh = True
14781480 else :
14791481 state .pop ('task_id' , None )
14801482 save_state (state , state_file )
@@ -1511,7 +1513,7 @@ def cli():
15111513
15121514 # wait for machine to become available
15131515 try :
1514- wait_for_machine (state , task )
1516+ wait_for_machine (state , task , only_wait_for_ssh = only_wait_for_ssh )
15151517 except ValueError as ex :
15161518 print ('\n ERROR: {}' .format (ex ))
15171519 return 1
0 commit comments