2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-17 14:28:02 +00:00

reconnect.py: Fix Python 2.4 compatibility break.

Commit 5eda645e36 (ovsdb-server: Report time since last connect and disconnect
for each manager.) used a conditional expression in reconnect.py. That syntax
is only supported in Python 2.5 and later. XenServer 5.6 is based on RHEL 5,
which uses Python 2.4.3, so various OVS scripts on XenServer fail with Python
tracebacks.

Reported-by: Cedric Hobbs <cedric@nicira.com>
This commit is contained in:
Andrew Evans
2011-03-15 14:42:49 -07:00
parent e8fe30269a
commit 34d84bb951

View File

@@ -558,8 +558,9 @@ class Reconnect(object):
stats.is_connected = self.is_connected()
stats.msec_since_connect = self.get_last_connect_elapsed(now)
stats.msec_since_disconnect = self.get_last_disconnect_elapsed(now)
stats.total_connected_duration = self.total_connected_duration + \
(self.get_last_connect_elapsed(now) if self.is_connected() else 0)
stats.total_connected_duration = self.total_connected_duration
if self.is_connected():
stats.total_connected_duration += self.get_last_connect_elapsed(now)
stats.n_attempted_connections = self.n_attempted_connections
stats.n_successful_connections = self.n_successful_connections
stats.state = self.state.name