msmith - in flumotion/trunk: . flumotion/component

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Wed May 23 13:10:07 CEST 2007


Author: msmith
Date: Wed May 23 13:10:03 2007
New Revision: 5017

Modified:
   flumotion/trunk/ChangeLog
   flumotion/trunk/flumotion/component/component.py
Log:
        * flumotion/component/component.py:
          Allow the component to respond to getState() remote calls before
          login is complete, so that we can (in a later version) avoid some
          races (e.g. #624) in connecting components. Unfortunately we can't
          do that right now or a new manager will break existing components.



Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog	(original)
+++ flumotion/trunk/ChangeLog	Wed May 23 13:10:03 2007
@@ -1,3 +1,11 @@
+2007-05-23  Michael Smith <msmith at fluendo.com>
+
+	* flumotion/component/component.py:
+	  Allow the component to respond to getState() remote calls before
+	  login is complete, so that we can (in a later version) avoid some
+	  races (e.g. #624) in connecting components. Unfortunately we can't
+	  do that right now or a new manager will break existing components.
+
 2007-05-23  Andy Wingo  <wingo at pobox.com>
 
 	* flumotion/launch/parse.py (Component.complete_and_verify):

Modified: flumotion/trunk/flumotion/component/component.py
==============================================================================
--- flumotion/trunk/flumotion/component/component.py	(original)
+++ flumotion/trunk/flumotion/component/component.py	Wed May 23 13:10:03 2007
@@ -72,6 +72,10 @@
 
         self.logName = component.name
 
+    def clientConnectionMade(self, broker):
+        self.medium.broker = broker
+        fpb.ReconnectingFPBClientFactory.clientConnectionMade(self, broker)
+
     # vmethod implementation
     def gotDeferredLogin(self, d):
         def remoteDisconnected(remoteReference):
@@ -137,6 +141,11 @@
         """
         self.comp = component
         self.authenticator = None
+        self.broker = None
+
+    def setRemoteReference(self, reference):
+        self.broker = None # We no longer need that reference
+        medium.PingingMedium.setRemoteReference(self, reference)
 
     ### our methods
     def setup(self, config):
@@ -146,8 +155,9 @@
         """
         Return the manager IP as seen by us.
         """
-        assert self.remote
-        peer = self.remote.broker.transport.getPeer()
+        assert self.remote or self.broker
+        broker = self.broker or self.remote.broker
+        peer = broker.transport.getPeer()
         try:
             host = peer.host
         except AttributeError:


More information about the flumotion-commit mailing list