[node-patches] Change in ovirt-node[master]: functions: Yet another fix for retnum persistence

fabiand at redhat.com fabiand at redhat.com
Thu Sep 25 11:28:17 UTC 2014


Fabian Deutsch has uploaded a new change for review.

Change subject: functions: Yet another fix for retnum persistence
......................................................................

functions: Yet another fix for retnum persistence

There were two cases in which the new retnum variant of persist fails:

1. config file is still bind mounted
2. If everything goes well, then the function returned True
   which got interpreted as a return value of 1.

The target config file is now always unmounted, before a mount is tried,
and the return True  on success got removed.

Change-Id: I2caeea64c79bb55a614cd363082d70afcdd20501
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1120650
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/ovirt-functions.in
M scripts/ovirt-init-functions.sh.in
M src/ovirtnode/ovirtfunctions.py
3 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/65/33365/1

diff --git a/scripts/ovirt-functions.in b/scripts/ovirt-functions.in
index 2492dc0..05dc2f3 100644
--- a/scripts/ovirt-functions.in
+++ b/scripts/ovirt-functions.in
@@ -660,7 +660,7 @@
         python <<EOP
 from ovirtnode.ovirtfunctions import ovirt_store_config_retnum
 
-raise SystemExit(ovirt_store_config_retnum("$p"))
+ovirt_store_config_retnum("$p")
 EOP
         rc=$?
         if [ $rc -eq 1 ] || [ $rc -eq 2 ]; then
diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index d90b6eb..271f3a4 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -1248,7 +1248,7 @@
         ovirt_store_firstboot_config
         retval=$?
         if [ $retval -eq 1 ] || [ $retval -eq 2 ]; then
-            autoinstall_failed "Reason: Store firstboot issue"
+            autoinstall_failed "Reason: Store firstboot issue ($retval)"
         fi
 
         # rhbz#920208
diff --git a/src/ovirtnode/ovirtfunctions.py b/src/ovirtnode/ovirtfunctions.py
index 5b0fcfa..1bf00aa 100644
--- a/src/ovirtnode/ovirtfunctions.py
+++ b/src/ovirtnode/ovirtfunctions.py
@@ -889,6 +889,7 @@
         dirname = os.path.dirname(filename)
         system("mkdir -p /config/" + dirname)
         if system("cp -a " + filename + " /config"+filename):
+            system("umount "+filename)
             if not system("mount -n --bind /config"+filename+ " " + \
                           filename):
                 logger.error("Failed to persist: " + filename)
@@ -902,7 +903,6 @@
         system_closefds("echo "+filename+" >> /config/files")
         logger.info("Successfully persisted: " + filename)
 
-    return True
 
 def ovirt_store_config_atomic(filename, source=None):
     rc = True


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

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



More information about the node-patches mailing list