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

fabiand at redhat.com fabiand at redhat.com
Wed Oct 22 05:02:27 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/38/34338/1

diff --git a/scripts/ovirt-functions.in b/scripts/ovirt-functions.in
index e8c53bd..046981b 100644
--- a/scripts/ovirt-functions.in
+++ b/scripts/ovirt-functions.in
@@ -651,7 +651,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 531e91a..2788915 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -1214,7 +1214,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 e07764f..8dc9557 100644
--- a/src/ovirtnode/ovirtfunctions.py
+++ b/src/ovirtnode/ovirtfunctions.py
@@ -890,6 +890,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)
@@ -903,7 +904,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/34338
To unsubscribe, visit http://gerrit.ovirt.org/settings

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



More information about the node-patches mailing list