summaryrefslogtreecommitdiff
path: root/python/ovs/reconnect.py
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2012-04-11 20:42:01 -0700
committerEthan Jackson <ethan@nicira.com>2012-04-12 00:43:22 -0700
commitbceb55c8ba91af812bc61e1ebc54f367ad034157 (patch)
tree7cc5e579d736527366303f74e07d5d9bc82e2504 /python/ovs/reconnect.py
parent3d792b703f587f42475566b6e92f852d60e85ca2 (diff)
downloadopenvswitch-bceb55c8ba91af812bc61e1ebc54f367ad034157.tar.gz
python: Honor zero probe interval in reconnect.py
The python reconnect library attempted to send a probe every 0 milliseconds instead of disabling probing when the probe_interval was zero. Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'python/ovs/reconnect.py')
-rw-r--r--python/ovs/reconnect.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/ovs/reconnect.py b/python/ovs/reconnect.py
index 7e58f5041..f1da930a7 100644
--- a/python/ovs/reconnect.py
+++ b/python/ovs/reconnect.py
@@ -112,7 +112,9 @@ class Reconnect(object):
@staticmethod
def deadline(fsm):
- return fsm.state_entered + fsm.probe_interval
+ if fsm.probe_interval:
+ return fsm.state_entered + fsm.probe_interval
+ return None
@staticmethod
def run(fsm, now):
@@ -504,7 +506,9 @@ class Reconnect(object):
connection is indeed in working order. (This will only be
returned if the "probe interval" is nonzero--see
self.set_probe_interval())."""
- if now >= self.state.deadline(self):
+
+ deadline = self.state.deadline(self)
+ if deadline is not None and now >= deadline:
return self.state.run(self, now)
else:
return None