[node-patches] Change in ovirt-node[master]: Fix persistence logic
fabiand at redhat.com
fabiand at redhat.com
Fri Sep 19 13:07:49 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/77/33077/1
diff --git a/scripts/ovirt-functions.in b/scripts/ovirt-functions.in
index 1e8aa7d..69f0009 100644
--- a/scripts/ovirt-functions.in
+++ b/scripts/ovirt-functions.in
@@ -667,7 +667,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
@@ -1119,6 +1124,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 4d6ed02..d90b6eb 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -498,7 +498,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"
@@ -1218,11 +1218,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
@@ -1242,13 +1242,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
@@ -1263,7 +1263,7 @@
reboot
if [ $? -ne 0 ]; then
- autoinstall_failed
+ autoinstall_failed "Reason: Reboot ..."
fi
return 1
fi
--
To view, visit http://gerrit.ovirt.org/33077
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7749fb2a423283c5748cbe990374d4790cffeb99
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