rhel: Set STP of a bridge during bridge creation.
authorGurucharan Shetty <gshetty@nicira.com>
Mon, 18 Mar 2013 17:18:15 +0000 (10:18 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Mon, 18 Mar 2013 19:30:59 +0000 (12:30 -0700)
This patch sets the value of STP (if provided) at the same
time of bridge creation. This eliminates an extra ovs-vsctl call
and does not let ovs-vswitchd run briefly with STP not enabled.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
rhel/etc_sysconfig_network-scripts_ifup-ovs

index b362520..8904c59 100755 (executable)
@@ -70,7 +70,8 @@ case "$TYPE" in
                # because it remained in the OVSDB for some reason, but it won't be up.
                if check_device_down "${DEVICE}"; then
                        ovs-vsctl -t ${TIMEOUT} -- --may-exist add-br "$DEVICE" $OVS_OPTIONS \
-                       ${OVS_EXTRA+-- $OVS_EXTRA}
+                       ${OVS_EXTRA+-- $OVS_EXTRA} \
+                       ${STP+-- set bridge "$DEVICE" stp_enable="${STP}"}
                else
                        OVSBRIDGECONFIGURED="yes"
                fi
@@ -94,7 +95,6 @@ case "$TYPE" in
                        [ "${OVSBRIDGECONFIGURED}" != "yes" ]; then
                        ${OTHERSCRIPT} ${CONFIG}
                fi
-               [ -n "${STP}" ] && ovs-vsctl --no-wait set bridge "${DEVICE}" stp_enable="${STP}"
                exit 0
                ;;
        OVSPort)