From: Gurucharan Shetty Date: Fri, 26 Oct 2012 18:17:17 +0000 (-0700) Subject: ovs-save: Use timeout option for ovs-vsctl X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49770faf0d497e2a0b07f43163728c17b3e7363b;p=openvswitch ovs-save: Use timeout option for ovs-vsctl Running ovs-save directly to save datapath configuration can wait forever if ovsdb-server is not running. Use a timeout. Signed-off-by: Gurucharan Shetty --- diff --git a/utilities/ovs-save b/utilities/ovs-save index 9ed14ebb..01e57914 100755 --- a/utilities/ovs-save +++ b/utilities/ovs-save @@ -177,6 +177,10 @@ save_flows () { done } +ovs_vsctl () { + ovs-vsctl --no-wait --timeout=5 "$@" +} + save_datapaths () { if missing_program ovs-dpctl; then echo "$0: ovs-dpctl not found in $PATH" >&2 @@ -225,20 +229,20 @@ save_datapaths () { # For ipsec, ovs-dpctl does not show the key value pairs related # to certificates. Get that information from ovs-vsctl. if [ "${type}" = "ipsec_gre" ] ; then - if peer_cert=`ovs-vsctl get interface \ + if peer_cert=`ovs_vsctl get interface \ "${netdev}" options:peer_cert 2>/dev/null`; then # The option peer_cert comes with an accompanying # "certificate" or "use_ssl_cert" - if certificate=`ovs-vsctl get interface "${netdev}" \ + if certificate=`ovs_vsctl get interface "${netdev}" \ options:certificate 2>/dev/null` ; then command="${command},peer_cert=${peer_cert},certificate=${certificate}" else - use_ssl_cert=`ovs-vsctl get interface "${netdev}" \ + use_ssl_cert=`ovs_vsctl get interface "${netdev}" \ options:use_ssl_cert 2>/dev/null` command="${command},peer_cert=${peer_cert},use_ssl_cert=${use_ssl_cert}" fi else - psk=`ovs-vsctl get interface "${netdev}" \ + psk=`ovs_vsctl get interface "${netdev}" \ options:psk 2>/dev/null` command="${command},psk=${psk}" fi