aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Trautman <ctrautma@redhat.com>2016-09-20 12:34:55 -0400
committerChristian Trautman <ctrautma@redhat.com>2016-10-03 10:39:52 -0400
commitaf5315b3e713d65256aea791da89dd74c90e4072 (patch)
tree2b359cad6cf701607f4b4561025cd22405be6b6d
parent5b7cf3e52902ca12d2c61aaa34761454ee0e5bf9 (diff)
cmd_timeout: Add ovs command timeout configuration option
Adds option for configurable timeout for ovs commands. JIRA: VSPERF-396 Change-Id: Ie73dfea1a088a5c92bef705f1fe874ddeeaec5a7 Signed-off-by: Christian Trautman <ctrautma@redhat.com>
-rw-r--r--conf/02_vswitch.conf3
-rw-r--r--src/ovs/ofctl.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/conf/02_vswitch.conf b/conf/02_vswitch.conf
index e504d3ad..f9b8f957 100644
--- a/conf/02_vswitch.conf
+++ b/conf/02_vswitch.conf
@@ -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
# ############################
diff --git a/src/ovs/ofctl.py b/src/ovs/ofctl.py
index 27349a92..e9b86127 100644
--- a/src/ovs/ofctl.py
+++ b/src/ovs/ofctl.py
@@ -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