=== modified file 'lava_dispatcher/actions/launch_control.py'
@@ -106,7 +106,9 @@
"""
client = self.client
try:
- self.in_master_shell()
+ client.in_master_shell()
+ except OperationFailed:
+ client.boot_master_image()
except:
logging.exception("in_master_shell failed")
client.boot_master_image()
@@ -154,11 +156,10 @@
while time.time() < now + timeout:
try:
result_path = download(result_tarball, tarball_dir)
- except:
+ except RuntimeError:
if time.time() >= now + timeout:
+ logging.exception("download failed")
raise
- else:
- logging.exception("download failed, retrying")
except:
logging.warning(traceback.format_exc())
status = 'fail'
=== modified file 'lava_dispatcher/client.py'
@@ -76,11 +76,12 @@
def default_network_interface(self):
return self.device_option("default_network_interface")
- def in_master_shell(self):
+ def in_master_shell(self, timeout=10):
""" Check that we are in a shell on the master image
"""
self.proc.sendline("")
- id = self.proc.expect([self.master_str, pexpect.TIMEOUT])
+ id = self.proc.expect([self.master_str, pexpect.TIMEOUT],
+ timeout=timeout)
if id == 1:
raise OperationFailed
@@ -98,11 +99,11 @@
self.soft_reboot()
try:
self.proc.expect("Starting kernel")
- self.in_master_shell()
+ self.in_master_shell(120)
except:
logging.exception("in_master_shell failed")
self.hard_reboot()
- self.in_master_shell()
+ self.in_master_shell(300)
self.proc.sendline('export PS1="$PS1 [rc=$(echo \$?)]: "')
self.proc.expect(self.master_str)
@@ -148,7 +149,7 @@
# XXX Workaround for snowball
if self.device_type == "snowball_sd":
time.sleep(10)
- self.in_master_shell()
+ self.in_master_shell(300)
# Intentionally avoid self.soft_reboot() to prevent looping
self.proc.sendline("reboot")
self.enter_uboot()