From 49770faf0d497e2a0b07f43163728c17b3e7363b Mon Sep 17 00:00:00 2001 From: Gurucharan Shetty Date: Fri, 26 Oct 2012 11:17:17 -0700 Subject: 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 --- utilities/ovs-save | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'utilities/ovs-save') diff --git a/utilities/ovs-save b/utilities/ovs-save index 9ed14ebb3..01e57914e 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 -- cgit v1.2.1