diff --git a/devices/debian.py b/devices/debian.py index 8a31ea23..b27ccd89 100644 --- a/devices/debian.py +++ b/devices/debian.py @@ -69,7 +69,7 @@ def __init__(self, def reset(self): self.sendline('reboot') - self.expect(['going down','disconnected']) + self.expect(['going down','disconnected', 'closed']) try: self.expect(self.prompt, timeout=10) except: @@ -79,14 +79,16 @@ def reset(self): try: pexpect.spawn('ping -w 1 -c 1 ' + self.name).expect('64 bytes', timeout=1) except: - print(self.name + " not up yet, after %s seconds." % (i + 15)) + time.sleep(1) + print(self.name + " not up yet, after %s tries." % (i)) else: - print("%s is back after %s seconds, waiting for network daemons to spawn." % (self.name, i + 14)) + print("%s is back after %s tries, waiting for network daemons to spawn." % (self.name, i)) time.sleep(15) break self.__init__(self.name, self.color, - self.output, self.username, + self.username, self.password, self.port, + output=self.output, reboot=False) def get_ip_addr(self, interface): diff --git a/devices/non_root_debian.py b/devices/non_root_debian.py index 8332dc2b..e096638e 100644 --- a/devices/non_root_debian.py +++ b/devices/non_root_debian.py @@ -76,7 +76,7 @@ def __init__(self, def reset(self): self.sendline('sudo reboot') - self.expect(['going down','disconnected']) + self.expect(['going down','disconnected', 'closed']) try: self.expect(self.prompt, timeout=10) except: @@ -86,14 +86,16 @@ def reset(self): try: pexpect.spawn('ping -w 1 -c 1 ' + self.name).expect('64 bytes', timeout=1) except: - print(self.name + " not up yet, after %s seconds." % (i + 15)) + time.sleep(1) + print(self.name + " not up yet, after %s tries." % (i)) else: - print("%s is back after %s seconds, waiting for network daemons to spawn." % (self.name, i + 14)) + print("%s is back after %s tries, waiting for network daemons to spawn." % (self.name, i)) time.sleep(15) break self.__init__(self.name, self.color, - self.output, self.username, + self.username, self.password, self.port, + output=self.output, reboot=False) def get_ip_addr(self, interface):