@@ -68,33 +68,35 @@ def _defn_to_xml_et(defn, /, *, parent=None):
68
68
69
69
def poweroff (ip ):
70
70
try :
71
- ssh (ip , ["poweroff" ], options = SSHOPTS )
71
+ ssh (ip , ["/sbin/ poweroff" ], options = SSHOPTS )
72
72
except SSHCommandFailed as e :
73
73
# ignore connection closed by reboot
74
74
if e .returncode == 255 and "closed by remote host" in e .stdout :
75
75
logging .info ("sshd closed the connection" )
76
76
pass
77
+ elif e .returncode == 255 :
78
+ logging .info ("sshd misbehaving?" )
77
79
else :
78
80
raise
79
81
80
82
def monitor_install (* , ip ):
81
83
# wait for "yum install" phase to finish
82
- wait_for (lambda : ssh (ip , ["grep" ,
84
+ wait_for (lambda : "DISPATCH: NEW PHASE: Completing installation" in ssh (ip , ["grep" ,
83
85
"'DISPATCH: NEW PHASE: Completing installation'" ,
84
86
"/tmp/install-log" ],
85
87
check = False , simple_output = False ,
86
88
options = SSHOPTS ,
87
- ).returncode == 0 ,
89
+ ).stdout ,
88
90
"Wait for rpm installation to succeed" ,
89
91
timeout_secs = 40 * 60 ) # FIXME too big
90
92
91
93
# wait for install to finish
92
- wait_for (lambda : ssh (ip , ["grep" ,
94
+ wait_for (lambda : "The installation completed successfully" in ssh (ip , ["grep" ,
93
95
"'The installation completed successfully'" ,
94
96
"/tmp/install-log" ],
95
97
check = False , simple_output = False ,
96
98
options = SSHOPTS ,
97
- ).returncode == 0 ,
99
+ ).stdout ,
98
100
"Wait for system installation to succeed" ,
99
101
timeout_secs = 40 * 60 ) # FIXME too big
100
102
0 commit comments