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

f38
Thomas Graf 13 years ago
parent 932d11b08c
commit 002217b865

@ -22,6 +22,7 @@ cd /etc/sysconfig/network-scripts
[ -f ../network ] && . ../network [ -f ../network ] && . ../network
CONFIG=${1} CONFIG=${1}
TIMEOUT=10
source_config source_config
@ -37,12 +38,12 @@ case "$TYPE" in
OVSBridge) OVSBridge)
${OTHERSCRIPT} ${CONFIG} $2 ${OTHERSCRIPT} ${CONFIG} $2
retval=$? retval=$?
ovs-vsctl -- --if-exists del-br "$DEVICE" ovs-vsctl -t ${TIMEOUT} -- --if-exists del-br "$DEVICE"
;; ;;
OVSPort|OVSIntPort|OVSBond) OVSPort|OVSIntPort|OVSBond)
${OTHERSCRIPT} ${CONFIG} $2 ${OTHERSCRIPT} ${CONFIG} $2
retval=$? 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" echo $"Invalid OVS interface type $TYPE"

@ -22,6 +22,7 @@ cd /etc/sysconfig/network-scripts
[ -f ../network ] && . ../network [ -f ../network ] && . ../network
CONFIG=${1} CONFIG=${1}
TIMEOUT=10
need_config ${CONFIG} need_config ${CONFIG}
@ -35,7 +36,7 @@ fi
case "$TYPE" in case "$TYPE" in
OVSBridge) 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 if [ "${OVSBOOTPROTO}" = "dhcp" ] && [ -n "${OVSINTF}" ]; then
case " ${OVSDHCPINTERFACES} " in case " ${OVSDHCPINTERFACES} " in
*" ${OVSINTF} "*) *" ${OVSINTF} "*)
@ -50,12 +51,12 @@ case "$TYPE" in
OVSPort) OVSPort)
/sbin/ifup "$OVS_BRIDGE" /sbin/ifup "$OVS_BRIDGE"
${OTHERSCRIPT} ${CONFIG} ${2} ${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" OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE"
;; ;;
OVSIntPort) OVSIntPort)
/sbin/ifup "$OVS_BRIDGE" /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} ${OTHERSCRIPT} ${CONFIG} ${2}
;; ;;
OVSBond) OVSBond)
@ -63,7 +64,7 @@ case "$TYPE" in
for _iface in $BOND_IFACES; do for _iface in $BOND_IFACES; do
/sbin/ifup ${_iface} /sbin/ifup ${_iface}
done 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} ${OTHERSCRIPT} ${CONFIG} ${2}
OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE" OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE"
;; ;;

@ -1,6 +1,6 @@
Name: openvswitch Name: openvswitch
Version: 1.7.1 Version: 1.7.1
Release: 1%{?dist} Release: 2%{?dist}
Summary: Open vSwitch daemon/database/utilities Summary: Open vSwitch daemon/database/utilities
# Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
@ -204,6 +204,9 @@ desktop-file-install --dir=$RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE6}
%changelog %changelog
* Tue Oct 9 2012 Thomas Graf <tgraf@redhat.com> - 1.7.1-2
- make ovs-vsctl timeout if daemon is not running (#858722)
* Mon Sep 10 2012 Thomas Graf <tgraf@redhat.com> - 1.7.1.-1 * Mon Sep 10 2012 Thomas Graf <tgraf@redhat.com> - 1.7.1.-1
- Update to 1.7.1 - Update to 1.7.1

Loading…
Cancel
Save