Perry Myers
2009-Jan-20 21:56 UTC
[Ovirt-devel] [PATCH node] Add in better error reporting for o-c-networking and show network interface bringup
Signed-off-by: Perry Myers <pmyers at redhat.com> --- scripts/ovirt-config-networking | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 5727c47..9ede511 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -233,17 +233,27 @@ else fi start_log +net_configured=1 if ls "$WORKDIR"/augtool-* > /dev/null 2>&1 ; then log "Configuring network" config="$WORKDIR"/config-augtool cat "$WORKDIR"/augtool-* > $config \ - && augtool $config \ - && service network restart + && augtool $config if [ $? = 0 ]; then log "Network configured successfully" + net_configured=0 + ovirt_store_config /etc/sysconfig/network-scripts/ifcfg* else log "Error configuring network, see $OVIRT_LOGFILE" + stop_log + exit 1 fi fi -ovirt_store_config /etc/sysconfig/network-scripts/ifcfg* stop_log + +if [ "$net_configured" = 0 ]; then + service network stop > /dev/null 2>&1 + service network start +fi + +exit 0 -- 1.6.0.6
Alan Pevec
2009-Jan-20 22:29 UTC
[Ovirt-devel] [PATCH node] Add in better error reporting for o-c-networking and show network interface bringup
ack just: +net_configured=1 use normal boolean values where 1=true that twisted shell logic is just for return codes -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090120/d41fca8a/attachment.htm>