X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=python%2Fovs%2Freconnect.py;h=8817494686678d3d3ff8eddc65d02ccdbfece1a4;hb=1f9dd59cf178b0765727f6908e135f48c766e213;hp=5fc96bc8713a568a3ba7dc990be4bfd12ab8ce2d;hpb=34d84bb951caa50831f0a2f553b41d9da8ceb128;p=sliver-openvswitch.git diff --git a/python/ovs/reconnect.py b/python/ovs/reconnect.py index 5fc96bc87..881749468 100644 --- a/python/ovs/reconnect.py +++ b/python/ovs/reconnect.py @@ -1,4 +1,4 @@ -# Copyright (c) 2010 Nicira Networks +# Copyright (c) 2010, 2011 Nicira Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -117,7 +117,7 @@ class Reconnect(object): % (fsm.name, (now - fsm.state_entered) / 1000.0)) return DISCONNECT - class Reconnect: + class Reconnect(object): name = "RECONNECT" is_connected = False @@ -332,15 +332,15 @@ class Reconnect(object): % self.name) else: if self.passive: - type = "listen" + type_ = "listen" else: - type = "connection" + type_ = "connection" if error > 0: logging.warning("%s: %s attempt failed (%s)" - % (self.name, type, os.strerror(error))) + % (self.name, type_, os.strerror(error))) else: self.info_level("%s: %s attempt timed out" - % (self.name, type)) + % (self.name, type_)) if (self.state in (Reconnect.Active, Reconnect.Idle)): self.last_disconnected = now @@ -513,8 +513,8 @@ class Reconnect(object): def timeout(self, now): """Returns the number of milliseconds after which self.run() should be - called if nothing else notable happens in the meantime, or a negative - number if this is currently unnecessary.""" + called if nothing else notable happens in the meantime, or None if this + is currently unnecessary.""" deadline = self.state.deadline(self) if deadline is not None: remaining = deadline - now