[node-patches] Change in ovirt-node[master]: installer: Handle fs discovery more careful

fabiand at redhat.com fabiand at redhat.com
Mon Oct 27 09:50:58 UTC 2014


Fabian Deutsch has uploaded a new change for review.

Change subject: installer: Handle fs discovery more careful
......................................................................

installer: Handle fs discovery more careful

Previously findfs was called multiple times to discover a device for a
label, but that result was not used further on, instead it was tried to
discovered the device for a label again, and that could fail.

Now the device is discovered once, and reused further on.

Change-Id: I7326807c44f6906b2f216eef8be5a2b25d34b232
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1156112
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirtnode/install.py
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/99/34499/1

diff --git a/src/ovirtnode/install.py b/src/ovirtnode/install.py
index 51e861d..c6314f8 100755
--- a/src/ovirtnode/install.py
+++ b/src/ovirtnode/install.py
@@ -422,13 +422,15 @@
                               % boot_candidate_dev)
 
         candidate = None
+        candidate_dev = None
         candidate_names = ["RootBackup", "RootUpdate", "RootNew"]
         for trial in range(1, 3):
             time.sleep(1)
             _functions.system("partprobe")
             for candidate_name in candidate_names:
-                logger.debug("Finding %s: '%s'" % (candidate_name, _functions.findfs(candidate_name)))
-                if _functions.findfs(candidate_name):
+                candidate_dev = _functions.findfs(candidate_name)
+                logger.debug("Finding %s: '%s'" % (candidate_name, candidate_dev))
+                if candidate_dev:
                     candidate = candidate_name
                     logger.debug("Found: %s" % candidate)
                     break
@@ -450,7 +452,7 @@
             return False
 
         try:
-            candidate_dev = self.disk = _functions.findfs(candidate)
+            self.disk = candidate_dev
             logger.info("Candidate device: %s" % candidate_dev)
             logger.info("Candidate disk: %s" % self.disk)
             # grub2 starts at part 1
@@ -458,7 +460,7 @@
             if not _functions.grub2_available():
                 self.partN = self.partN - 1
         except:
-            logger.debug(traceback.format_exc())
+            logger.debug("Failed to get partition", exc_info=True)
             return False
 
         if self.disk is None or self.partN < 0:


-- 
To view, visit http://gerrit.ovirt.org/34499
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7326807c44f6906b2f216eef8be5a2b25d34b232
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>



More information about the node-patches mailing list