diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 572: hotfix: avoid undefined LavaContext#client in connect_to_serial

Message ID 20130401202913.32312.45194.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Antonio Terceiro April 1, 2013, 8:29 p.m. UTC
------------------------------------------------------------
revno: 572
committer: Antonio Terceiro <antonio.terceiro@linaro.org>
branch nick: trunk
timestamp: Mon 2013-04-01 17:26:48 -0300
message:
  hotfix: avoid undefined LavaContext#client in connect_to_serial
  
  connect_to_serial cannot use LavaContext#client because it's called from the
  code that produces the value of LavaContext#client (the client constructor)
modified:
  lava_dispatcher/device/master.py
  lava_dispatcher/device/sdmux.py
  lava_dispatcher/utils.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/device/master.py'
--- lava_dispatcher/device/master.py	2013-03-25 20:23:35 +0000
+++ lava_dispatcher/device/master.py	2013-04-01 20:26:48 +0000
@@ -83,7 +83,7 @@ 
         if config.pre_connect_command:
             self.context.run_command(config.pre_connect_command)
 
-        self.proc = connect_to_serial(self.context)
+        self.proc = connect_to_serial(self.context, config)
 
     def get_device_version(self):
         return self.device_version

=== modified file 'lava_dispatcher/device/sdmux.py'
--- lava_dispatcher/device/sdmux.py	2013-02-18 04:01:02 +0000
+++ lava_dispatcher/device/sdmux.py	2013-04-01 20:26:48 +0000
@@ -221,7 +221,7 @@ 
         self.context.run_command(self.config.power_off_cmd)
 
     def power_on(self):
-        self.proc = connect_to_serial(self.context)
+        self.proc = connect_to_serial(self.context, self.config)
 
         logging.info('powering on')
         self.context.run_command(self.config.power_on_cmd)

=== modified file 'lava_dispatcher/utils.py'
--- lava_dispatcher/utils.py	2013-02-18 03:34:31 +0000
+++ lava_dispatcher/utils.py	2013-04-01 20:26:48 +0000
@@ -214,7 +214,7 @@ 
                 timeout=1, lava_no_logging=1)
 
 
-def connect_to_serial(context):
+def connect_to_serial(context, config):
     """
     Attempts to connect to a serial console server like conmux or cyclades
     """
@@ -238,7 +238,7 @@ 
 
     while retry_count < retry_limit:
         proc = context.spawn(
-            context.client.config.connection_command,
+            config.connection_command,
             timeout=1200)
         logging.info('Attempting to connect to device')
         match = proc.expect(patterns, timeout=10)
@@ -253,7 +253,7 @@ 
             atexit.register(proc.close, True)
             return proc
         elif result == 'reset-port':
-            reset_cmd = context.client.config.reset_port_command
+            reset_cmd = config.reset_port_command
             if reset_cmd:
                 context.run_command(reset_cmd)
             else: