diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 432: Fix while/except drop through bug

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

Commit Message

Dave Pigott Nov. 1, 2012, 3:26 p.m. UTC
Merge authors:
  Dave Pigott (dpigott)
Related merge proposals:
  https://code.launchpad.net/~dpigott/lava-dispatcher/fix-except-while-drop-through/+merge/132572
  proposed by: Dave Pigott (dpigott)
  review: Approve - Dave Pigott (dpigott)
------------------------------------------------------------
revno: 432 [merge]
committer: dave.pigott@linaro.org
branch nick: lava-dispatcher
timestamp: Thu 2012-11-01 16:15:21 +0100
message:
  Fix while/except drop through bug
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-31 21:58:30 +0000
+++ lava_dispatcher/device/master.py	2012-11-01 15:11:08 +0000
@@ -458,12 +458,15 @@ 
         network_up = False
         attempts = 1
         while (attempts <> 0) and (not network_up):
-            try:
-                self.wait_network_up()
+            while True:
+                try:
+                    self.wait_network_up()
+                except NetworkError:
+                    self._client.boot_master_image()
+                    attempts = attempts - 1
+                    continue
                 network_up = True
-            except NetworkError:
-                self._client.boot_master_image()
-                attempts = attempts-1
+                break
         if not network_up:
             msg = "Unable to reach LAVA server, check network"
             logging.error(msg)