diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 433: Fix recursive boot problem

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

Commit Message

Dave Pigott Nov. 2, 2012, 12:15 p.m. UTC
Merge authors:
  Dave Pigott (dpigott)
Related merge proposals:
  https://code.launchpad.net/~dpigott/lava-dispatcher/fix-recursive-boot/+merge/132683
  proposed by: Dave Pigott (dpigott)
------------------------------------------------------------
revno: 433 [merge]
committer: dave.pigott@linaro.org
branch nick: trunk
timestamp: Fri 2012-11-02 13:14:09 +0100
message:
  Fix recursive boot problem
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-11-01 15:11:08 +0000
+++ lava_dispatcher/device/master.py	2012-11-02 11:32:31 +0000
@@ -344,9 +344,9 @@ 
         self.proc.expect(self.config.image_boot_msg, timeout=300)
         self.proc.expect(self.config.master_str, timeout=300)
 
-    def boot_master_image(self):
+    def do_boot_master(self):
         """
-        reboot the system, and check that we are in a master shell
+        sole boot - just boot the master image and don't do anything else
         """
         logging.info("Booting the system master image")
         try:
@@ -361,6 +361,13 @@ 
                 msg = "Hard reboot into master image failed: %s" % e
                 logging.critical(msg)
                 raise CriticalError(msg)
+
+
+    def boot_master_image(self):
+        """
+        reboot the system, and check that we are in a master shell
+        """
+        self.do_boot_master()
         self.proc.sendline('export PS1="%s"' % self.MASTER_PS1)
         self.proc.expect(
             self.MASTER_PS1_PATTERN, timeout=120, lava_no_logging=1)
@@ -456,13 +463,13 @@ 
     def get_master_ip(self):
         logging.info("Waiting for network to come up")
         network_up = False
-        attempts = 1
+        attempts = 2
         while (attempts <> 0) and (not network_up):
             while True:
                 try:
                     self.wait_network_up()
                 except NetworkError:
-                    self._client.boot_master_image()
+                    self._client.do_boot_master()
                     attempts = attempts - 1
                     continue
                 network_up = True