cmd_timeout: Add ovs command timeout configuration option 97/21897/4
authorChristian Trautman <ctrautma@redhat.com>
Tue, 20 Sep 2016 16:34:55 +0000 (12:34 -0400)
committerChristian Trautman <ctrautma@redhat.com>
Mon, 3 Oct 2016 14:39:52 +0000 (10:39 -0400)
Adds option for configurable timeout for ovs commands.

JIRA: VSPERF-396

Change-Id: Ie73dfea1a088a5c92bef705f1fe874ddeeaec5a7
Signed-off-by: Christian Trautman <ctrautma@redhat.com>
conf/02_vswitch.conf
src/ovs/ofctl.py

index e504d3a..f9b8f95 100644 (file)
@@ -12,6 +12,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# OVS Command timeout for execution of commands.
+OVS_CMD_TIMEOUT = 10
+
 # ############################
 # DPDK configuration
 # ############################
index 27349a9..e9b8612 100644 (file)
@@ -29,13 +29,14 @@ from tools import tasks
 from conf import settings
 
 _OVS_BRIDGE_NAME = settings.getValue('VSWITCH_BRIDGE_NAME')
+_OVS_CMD_TIMEOUT = settings.getValue('OVS_CMD_TIMEOUT')
 
 _CACHE_FILE_NAME = '/tmp/vsperf_flows_cache'
 
 class OFBase(object):
     """Add/remove/show datapaths using ``ovs-ofctl``.
     """
-    def __init__(self, timeout=10):
+    def __init__(self, timeout=_OVS_CMD_TIMEOUT):
         """Initialise logger.
 
         :param timeout: Timeout to be used for each command
@@ -138,7 +139,7 @@ class OFBase(object):
 class OFBridge(OFBase):
     """Control a bridge instance using ``ovs-vsctl`` and ``ovs-ofctl``.
     """
-    def __init__(self, br_name=_OVS_BRIDGE_NAME, timeout=10):
+    def __init__(self, br_name=_OVS_BRIDGE_NAME, timeout=_OVS_CMD_TIMEOUT):
         """Initialise bridge.
 
         :param br_name: Bridge name