diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 427: Add reboot if network doesn't come up

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

Commit Message

Dave Pigott Oct. 31, 2012, 1:38 p.m. UTC
------------------------------------------------------------
revno: 427
committer: dave.pigott@linaro.org
branch nick: network-retry
timestamp: Wed 2012-10-31 14:24:29 +0100
message:
  Add reboot if network doesn't come up
modified:
  lava_dispatcher/device/master.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	2012-10-25 11:27:27 +0000
+++ lava_dispatcher/device/master.py	2012-10-31 13:24:29 +0000
@@ -454,9 +454,16 @@ 
 
     def get_master_ip(self):
         logging.info("Waiting for network to come up")
-        try:
-            self.wait_network_up()
-        except:
+        network_up = False
+        attempts = 1
+        while (attempts <> 0) and (not network_up):
+            try:
+                self.wait_network_up()
+                network_up = True
+            except:
+                target.boot_master_image()
+                attempts = attempts-1
+        if not network_up:
             msg = "Unable to reach LAVA server, check network"
             logging.error(msg)
             self._client.sio.write(traceback.format_exc())