[openvswitch/f17] make ovs-vsctl timeout if daemon is not running (#858722)

Thomas Graf tgraf at fedoraproject.org
Wed Oct 10 10:24:51 UTC 2012


commit 3d5e256bfab470db2c7c5b2f00caa661a568bc01
Author: Thomas Graf <tgraf at suug.ch>
Date:   Tue Oct 9 17:02:23 2012 +0200

    make ovs-vsctl timeout if daemon is not running (#858722)

 ifdown-ovs       |    5 +++--
 ifup-ovs         |    9 +++++----
 openvswitch.spec |    5 ++++-
 3 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/ifdown-ovs b/ifdown-ovs
index 3b5252d..19047d8 100644
--- a/ifdown-ovs
+++ b/ifdown-ovs
@@ -22,6 +22,7 @@ cd /etc/sysconfig/network-scripts
 [ -f ../network ] && . ../network
 
 CONFIG=${1}
+TIMEOUT=10
 
 source_config
 
@@ -37,12 +38,12 @@ case "$TYPE" in
 	OVSBridge)
 		${OTHERSCRIPT} ${CONFIG} $2
 		retval=$?
-		ovs-vsctl -- --if-exists del-br "$DEVICE"
+		ovs-vsctl -t ${TIMEOUT} -- --if-exists del-br "$DEVICE"
 		;;
 	OVSPort|OVSIntPort|OVSBond)
 		${OTHERSCRIPT} ${CONFIG} $2
 		retval=$?
-		ovs-vsctl -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE"
+		ovs-vsctl -t ${TIMEOUT} -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE"
 		;;
 	*)
 		echo $"Invalid OVS interface type $TYPE"
diff --git a/ifup-ovs b/ifup-ovs
index b800ce0..c427879 100644
--- a/ifup-ovs
+++ b/ifup-ovs
@@ -22,6 +22,7 @@ cd /etc/sysconfig/network-scripts
 [ -f ../network ] && . ../network
 
 CONFIG=${1}
+TIMEOUT=10
 
 need_config ${CONFIG}
 
@@ -35,7 +36,7 @@ fi
 
 case "$TYPE" in
 	OVSBridge)
-		ovs-vsctl -- --may-exist add-br "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
+		ovs-vsctl -t ${TIMEOUT} -- --may-exist add-br "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
 		if [ "${OVSBOOTPROTO}" = "dhcp" ] && [ -n "${OVSINTF}" ]; then
 			case " ${OVSDHCPINTERFACES} " in
 				*" ${OVSINTF} "*)
@@ -50,12 +51,12 @@ case "$TYPE" in
 	OVSPort)
 		/sbin/ifup "$OVS_BRIDGE"
 		${OTHERSCRIPT} ${CONFIG} ${2}
-		ovs-vsctl -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
+		ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
 		OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE"
 		;;
 	OVSIntPort)
 		/sbin/ifup "$OVS_BRIDGE"
-		ovs-vsctl -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=internal ${OVS_EXTRA+-- $OVS_EXTRA}
+		ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=internal ${OVS_EXTRA+-- $OVS_EXTRA}
 		${OTHERSCRIPT} ${CONFIG} ${2}
 		;;
 	OVSBond)
@@ -63,7 +64,7 @@ case "$TYPE" in
 		for _iface in $BOND_IFACES; do
 			/sbin/ifup ${_iface}
 		done
-		ovs-vsctl -- --fake-iface add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
+		ovs-vsctl -t ${TIMEOUT} -- --fake-iface add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
 		${OTHERSCRIPT} ${CONFIG} ${2}
 		OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE"
 		;;
diff --git a/openvswitch.spec b/openvswitch.spec
index ff94abf..61c2346 100644
--- a/openvswitch.spec
+++ b/openvswitch.spec
@@ -1,6 +1,6 @@
 Name:           openvswitch
 Version:        1.4.2
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Open vSwitch daemon/database/utilities
 
 # Nearly all of openvswitch is ASL 2.0.  The bugtool is LGPLv2+, and the
@@ -218,6 +218,9 @@ fi
 
 
 %changelog
+* Wed Oct 10 2012 Thomas Graf <tgraf at redhat.com> - 1.4.2-3
+- make ovs-vsctl timeout if daemon is not running (#858722)
+
 * Fri Sep 10 2012 Thomas Graf <tgraf at redhat.com> - 1.4.2-2
 - add controller package containing ovs-controller
 


More information about the scm-commits mailing list