Darryl L. Pierce
2009-Apr-27 21:29 UTC
[Ovirt-devel] [PATCH node] Add support for aborting config scripts.
If a script is aborted, then the script exits with a return code of 99.
The o-c-setup script then interprets that as an abort and not a failure.
Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
---
scripts/ovirt-config-boot-wrapper | 2 +-
scripts/ovirt-config-setup | 15 +++++++++------
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/scripts/ovirt-config-boot-wrapper
b/scripts/ovirt-config-boot-wrapper
index 664d485..ff6f6e5 100755
--- a/scripts/ovirt-config-boot-wrapper
+++ b/scripts/ovirt-config-boot-wrapper
@@ -33,7 +33,7 @@ continuing."
break
elif [ "$r" == "N" ]; then
printf "\nExiting back to the menu\n"
- rc=1
+ rc=99
break
fi
done
diff --git a/scripts/ovirt-config-setup b/scripts/ovirt-config-setup
index 218d73b..9e8331b 100755
--- a/scripts/ovirt-config-setup
+++ b/scripts/ovirt-config-setup
@@ -55,12 +55,15 @@ while true; do
*)
{
printf "\n\n"
- if $CONFIG_DIR/*"$OPTION" ; then
- printf "\n"
- else
- printf "\nERROR: $OPTION FAILED. "
- printf "See $OVIRT_LOGFILE\n\n"
- fi
+ $CONFIG_DIR/*"$OPTION"
+ rc=$?
+ case $rc in
+ 0) printf "\n";;
+ 99) printf "\n$OPTION ABORTED.\n\n";;
+ *) printf "\nERROR: $OPTION FAILED. "
+ printf "See $OVIRT_LOGFILE\n\n"
+ ;;
+ esac
} 2>&1 | tee -a $OVIRT_TMP_LOGFILE;
if [ -f $OVIRT_TMP_LOGFILE ]; then
cat $OVIRT_TMP_LOGFILE >> $OVIRT_LOGFILE
--
1.6.0.6
Darryl L. Pierce
2009-Apr-28 13:34 UTC
[Ovirt-devel] Re: [PATCH node] Add support for aborting config scripts.
On Mon, Apr 27, 2009 at 05:29:44PM -0400, Darryl L. Pierce wrote:> If a script is aborted, then the script exits with a return code of 99. > The o-c-setup script then interprets that as an abort and not a failure. > > Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> > ---Pushed upstream. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Virtual Machine Management - http://www.ovirt.org/ Is fearr Gaeilge bhriste n? B?arla cliste. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090428/5b086218/attachment.sig>