Skip to content

Commit 72f98fa

Browse files
committed
fixup! WIP XS 6.5
1 parent f63c99f commit 72f98fa

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Diff for: lib/commands.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ def _ssh(hostname_or_ip, cmd, check, simple_output, suppress_fingerprint_warning
112112
# Get a decoded version of the output in any case, replacing potential errors
113113
output_for_errors = res.stdout.decode(errors='replace').strip()
114114

115-
# Even if check is False, we still raise in case of return code 255, which means a SSH error.
116-
if res.returncode == 255:
117-
return False, SSHCommandFailed(255, "SSH Error: %s" % output_for_errors, command)
115+
# # Even if check is False, we still raise in case of return code 255, which means a SSH error.
116+
# if res.returncode == 255:
117+
# return False, SSHCommandFailed(255, "SSH Error: %s" % output_for_errors, command)
118118

119119
output = res.stdout
120120
if config.ignore_ssh_banner:
@@ -125,7 +125,7 @@ def _ssh(hostname_or_ip, cmd, check, simple_output, suppress_fingerprint_warning
125125
if decode:
126126
output = output.decode()
127127

128-
if res.returncode and check:
128+
if res.returncode not in (0, 255) and check:
129129
return False, SSHCommandFailed(res.returncode, output_for_errors, command)
130130

131131
if simple_output:

Diff for: lib/installer.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -68,33 +68,35 @@ def _defn_to_xml_et(defn, /, *, parent=None):
6868

6969
def poweroff(ip):
7070
try:
71-
ssh(ip, ["poweroff"], options=SSHOPTS)
71+
ssh(ip, ["/sbin/poweroff"], options=SSHOPTS)
7272
except SSHCommandFailed as e:
7373
# ignore connection closed by reboot
7474
if e.returncode == 255 and "closed by remote host" in e.stdout:
7575
logging.info("sshd closed the connection")
7676
pass
77+
elif e.returncode == 255:
78+
logging.info("sshd misbehaving?")
7779
else:
7880
raise
7981

8082
def monitor_install(*, ip):
8183
# 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",
8385
"'DISPATCH: NEW PHASE: Completing installation'",
8486
"/tmp/install-log"],
8587
check=False, simple_output=False,
8688
options=SSHOPTS,
87-
).returncode == 0,
89+
).stdout,
8890
"Wait for rpm installation to succeed",
8991
timeout_secs=40 * 60) # FIXME too big
9092

9193
# wait for install to finish
92-
wait_for(lambda: ssh(ip, ["grep",
94+
wait_for(lambda: "The installation completed successfully" in ssh(ip, ["grep",
9395
"'The installation completed successfully'",
9496
"/tmp/install-log"],
9597
check=False, simple_output=False,
9698
options=SSHOPTS,
97-
).returncode == 0,
99+
).stdout,
98100
"Wait for system installation to succeed",
99101
timeout_secs=40 * 60) # FIXME too big
100102

0 commit comments

Comments
 (0)