msmith - in flumotion/branches/platform-3: . flumotion/component flumotion/component/base flumotion/manager

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Fri Jun 1 12:53:43 CEST 2007


Author: msmith
Date: Fri Jun  1 12:53:40 2007
New Revision: 5082

Modified:
   flumotion/branches/platform-3/ChangeLog
   flumotion/branches/platform-3/flumotion/component/base/http.py
   flumotion/branches/platform-3/flumotion/component/component.py
   flumotion/branches/platform-3/flumotion/manager/manager.py
Log:
        * flumotion/component/base/http.py:
          Backport: don't traceback in logs on failed authentication

        * flumotion/component/component.py:
          Backport: respond correctly to getState() remote calls before
          setRemoteReference() has been called.

        * flumotion/manager/manager.py:
          Backport: clear messages after the component has detached, not
          before, to avoid spurious tracebacks from components trying to
          remove messages that are already removed.



Modified: flumotion/branches/platform-3/ChangeLog
==============================================================================
--- flumotion/branches/platform-3/ChangeLog	(original)
+++ flumotion/branches/platform-3/ChangeLog	Fri Jun  1 12:53:40 2007
@@ -1,3 +1,17 @@
+2007-06-01  Michael Smith <msmith at fluendo.com>
+
+	* flumotion/component/base/http.py:
+	  Backport: don't traceback in logs on failed authentication
+
+	* flumotion/component/component.py:
+	  Backport: respond correctly to getState() remote calls before
+	  setRemoteReference() has been called.
+
+	* flumotion/manager/manager.py:
+	  Backport: clear messages after the component has detached, not
+	  before, to avoid spurious tracebacks from components trying to
+	  remove messages that are already removed.
+
 2007-05-31  Michael Smith <msmith at fluendo.com>
 
 	* flumotion/component/misc/httpfile/httpfile.py:

Modified: flumotion/branches/platform-3/flumotion/component/base/http.py
==============================================================================
--- flumotion/branches/platform-3/flumotion/component/base/http.py	(original)
+++ flumotion/branches/platform-3/flumotion/component/base/http.py	Fri Jun  1 12:53:40 2007
@@ -274,7 +274,7 @@
     def _authenticatedErrback(self, failure, request):
         failure.trap(errors.UnknownComponentError, errors.NotAuthenticatedError)
         self._handleUnauthorized(request)
-        raise errors.HandledException(failure)
+        return None
         
     def _handleUnauthorized(self, request):
         self.debug('client from %s is unauthorized' % (request.getClientIP()))

Modified: flumotion/branches/platform-3/flumotion/component/component.py
==============================================================================
--- flumotion/branches/platform-3/flumotion/component/component.py	(original)
+++ flumotion/branches/platform-3/flumotion/component/component.py	Fri Jun  1 12:53:40 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:

Modified: flumotion/branches/platform-3/flumotion/manager/manager.py
==============================================================================
--- flumotion/branches/platform-3/flumotion/manager/manager.py	(original)
+++ flumotion/branches/platform-3/flumotion/manager/manager.py	Fri Jun  1 12:53:40 2007
@@ -618,11 +618,6 @@
         @rtype: L{defer.Deferred}
         """
         self.debug('componentStop(%r)' % componentState)
-        # clear all messages
-        for m in componentState.get('messages'):
-            self.debug('Removing message %r' % m)
-            componentState.remove('messages', m)
-
         # We permit stopping a component even if it has a pending mood of
         # happy, so that if it never gets to happy, we can still stop it.
         if (componentState.get('moodPending') != None and
@@ -948,6 +943,12 @@
         self._depgraph.setJobStopped(componentAvatar.componentState)
         componentAvatar.componentState.set('moodPending', None)
 
+        # Now we're detached (not proxying state from the component),
+        # clear all remaining messages
+        for m in componentAvatar.componentState.get('messages'):
+            self.debug('Removing message %r' % m)
+            componentAvatar.componentState.remove('messages', m)
+
         # detach componentstate fom avatar
         componentAvatar.componentState = None
         componentAvatar.jobState = None


More information about the flumotion-commit mailing list