File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -341,13 +341,17 @@ def wait_for_network(container, timeout=30):
341341 time .sleep (attempt * 5 )
342342 else :
343343 break
344+ else :
345+ # this else will only run when for finishes without a
346+ # break (meaning it kept erroring)
347+ raise Exception ('Unable to add_machine' )
344348
345- assert len (model .machines ) == 1
349+ assert len (model .machines ) == 1
346350
347- res = await machine1 .destroy (force = True )
351+ res = await machine1 .destroy (force = True )
348352
349- assert res is None
350- assert len (model .machines ) == 0
353+ assert res is None
354+ assert len (model .machines ) == 0
351355
352356 container .stop (wait = True )
353357 container .delete (wait = True )
@@ -451,9 +455,15 @@ def wait_for_network(container, timeout=30):
451455 private_key_path ,
452456 ))
453457 except (paramiko .ssh_exception .NoValidConnectionsError , paramiko .ssh_exception .AuthenticationException ):
458+ # if we get an exception, try again
454459 time .sleep (attempt * 5 )
455460 else :
461+ # try part finished without exception
456462 break
463+ else :
464+ # this else will only run when for finishes without a
465+ # break (meaning it kept erroring)
466+ raise Exception ('Unable to add_machine' )
457467
458468 assert len (model .machines ) == 1
459469
You can’t perform that action at this time.
0 commit comments