[node-patches] Change in ovirt-node[node-3.0]: Fix persistence logic

fabiand at redhat.com fabiand at redhat.com
Wed Sep 24 09:44:51 UTC 2014


Fabian Deutsch has uploaded a new change for review.

Change subject: Fix persistence logic
......................................................................

Fix persistence logic

Previously the return code of a list of files which needed to be
persisted, was determined by the last file to be persisted. And even if
there was no severe issue, it could lead to a situation where the retun
code was unequal 0, which returned to a failed auto-installation.

This patch also introduces some better descriptions for failed
auto-installations.

Change-Id: I7749fb2a423283c5748cbe990374d4790cffeb99
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
2 files changed, 13 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/19/33319/1

diff --git a/scripts/ovirt-functions.in b/scripts/ovirt-functions.in
index 502de41..e8c53bd 100644
--- a/scripts/ovirt-functions.in
+++ b/scripts/ovirt-functions.in
@@ -658,7 +658,12 @@
             return $rc
         fi
     done
-    return $rc
+    # We alwasy return 0 here, because:
+    # If any of the persisted files in $@ had a severe issue
+    # (rc of 1 or 2), then we'd have already exited.
+    # But if we got here, then no severe issue was hit and
+    # we are good.
+    return 0
 }
 
 # check if stored config exists
@@ -1108,6 +1113,7 @@
     plymouth --hide-splash
     log "Automatic installation failed. Please review console messages."
     log "Press Enter to drop to emergency shell."
+    [[ -n $@ ]] && log "$@"
     [[ -f "/tmp/ovirt.log" ]] && {
         cat /tmp/ovirt.log >> /var/log/ovirt.log
     }
diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index 3a5f2d4..531e91a 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -497,7 +497,7 @@
                     for d in $appvgdisks; do
                         did="$(IFS="$oldIFS" parse_disk_id "$d")"
                         if [ -z "$did" ]; then
-                            autoinstall_failed
+                            autoinstall_failed "Reason: AppVG"
                         fi
                         if [ -n "$init_app" ]; then
                             init_app="$init_app${SEP}$did"
@@ -1182,11 +1182,11 @@
             rm -f $OVIRT_TMP_LOGFILE
         fi
         if [ $rc -ne 0 ]; then
-            autoinstall_failed
+            autoinstall_failed "Reason: Transactio issue"
         fi
     elif [ "$auto_install" = "2" ]; then
         echo "Device specified in storage_init does not exist"
-        autoinstall_failed
+        autoinstall_failed "Reason: Storage device issue"
     fi
 
     if is_stateless; then
@@ -1208,13 +1208,13 @@
 EOP
         fi
         if [ $? -ne 0 ]; then
-            autoinstall_failed
+            autoinstall_failed "Reason: Boot setup issue"
         fi
         disable_firstboot
         ovirt_store_firstboot_config
         retval=$?
         if [ $retval -eq 1 ] || [ $retval -eq 2 ]; then
-            autoinstall_failed
+            autoinstall_failed "Reason: Store firstboot issue"
         fi
 
         # rhbz#920208
@@ -1229,7 +1229,7 @@
         reboot
 
         if [ $? -ne 0 ]; then
-            autoinstall_failed
+            autoinstall_failed "Reason: Reboot ..."
         fi
         return 1
     fi


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7749fb2a423283c5748cbe990374d4790cffeb99
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