diff options
-rw-r--r-- | lava_dispatcher/client.py | 2 | ||||
-rw-r--r-- | lava_dispatcher/connection.py | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/lava_dispatcher/client.py b/lava_dispatcher/client.py index a13926aa7..47f372446 100644 --- a/lava_dispatcher/client.py +++ b/lava_dispatcher/client.py @@ -26,7 +26,7 @@ import traceback from utils import string_to_list import logging -from lava_dispatcher.proc import ( +from lava_dispatcher.connection import ( LavaConmuxConnection, ) diff --git a/lava_dispatcher/connection.py b/lava_dispatcher/connection.py index 976572643..749a61c41 100644 --- a/lava_dispatcher/connection.py +++ b/lava_dispatcher/connection.py @@ -29,9 +29,9 @@ class LavaConnection(object): def __init__(self, device_config, sio): self.device_config = device_config - self.proc = self._make_connection() + self.proc = self._make_connection(sio) - def _make_connection(self): + def _make_connection(self, sio): raise NotImplementedError(self._make_connection) def device_option(self, option_name): @@ -75,13 +75,14 @@ class LavaConnection(object): raise NotImplementedError(self.hard_reboot) -class LavaConmuxConnection(object): +class LavaConmuxConnection(LavaConnection): def _make_connection(self, sio): cmd = "conmux-console %s" % self.device_option("hostname") - self.proc = pexpect.spawn(cmd, timeout=3600, logfile=sio) + proc = pexpect.spawn(cmd, timeout=3600, logfile=sio) #serial can be slow, races do funny things if you don't increase delay - self.proc.delaybeforesend=1 + proc.delaybeforesend=1 + return proc def hard_reboot(self): self.proc.send("~$") |