File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -367,9 +367,8 @@ def create_masters(self) -> None:
367
367
logger .info ('updating /etc/hosts' )
368
368
self .update_etc_hosts ()
369
369
370
- logger .info ("Setting password to for root to redhat" )
371
- for master in master_nodes :
372
- master .set_password ()
370
+ nodes_with_futures = [(n .config .name , executor .submit (n .set_password )) for n in master_nodes ]
371
+ wait_futures ("set root password to redhat" , nodes_with_futures )
373
372
374
373
self .update_dnsmasq ()
375
374
@@ -440,10 +439,8 @@ def create_workers(self) -> None:
440
439
441
440
self .wait_for_workers ()
442
441
443
- logger .info ("Setting password to for root to redhat" )
444
- for h in hosts_with_workers :
445
- for worker in h .k8s_worker_nodes :
446
- worker .set_password ()
442
+ nodes_with_futures = [(n .config .name , executor .submit (n .set_password )) for n in worker_nodes ]
443
+ wait_futures ("set root password to redhat" , nodes_with_futures )
447
444
448
445
def _wait_master_reboot (self , infra_env : str , node : ClusterNode ) -> bool :
449
446
def master_ready (ai : AssistedClientAutomation , node_name : str ) -> bool :
Original file line number Diff line number Diff line change @@ -60,10 +60,11 @@ def teardown(self) -> None:
60
60
def ensure_reboot (self ) -> bool :
61
61
return True
62
62
63
- def set_password (self , user : str = "root" , password : str = "redhat" ) -> None :
63
+ def set_password (self , user : str = "root" , password : str = "redhat" ) -> bool :
64
64
rh = host .RemoteHost (self .ip ())
65
65
rh .ssh_connect ("core" )
66
66
rh .run_or_die (f"echo { user } :{ password } | sudo chpasswd" )
67
+ return True
67
68
68
69
def print_logs (self ) -> None :
69
70
rh = host .RemoteHost (self .ip ())
Original file line number Diff line number Diff line change @@ -680,6 +680,7 @@ def get_future_state(future: Future[bool]) -> str:
680
680
else :
681
681
return "Fail"
682
682
683
+ futures = sorted (futures )
683
684
state = {name : get_future_state (future ) for (name , future ) in futures }
684
685
logger .info (f"Waiting for { msg } : { state } " )
685
686
max_tries = 200 * 6
You can’t perform that action at this time.
0 commit comments