=== modified file 'landscape/broker/client.py' --- landscape/broker/client.py 2013-07-25 13:54:29 +0000 +++ landscape/broker/client.py 2016-01-13 10:23:21 +0000 @@ -1,6 +1,6 @@ from logging import info, exception -from twisted.internet.defer import maybeDeferred +from twisted.internet.defer import maybeDeferred, succeed from landscape.log import format_object from landscape.lib.twisted_util import gather_results @@ -67,7 +67,7 @@ """ if not (scopes is None or self.scope in scopes): # This resynchronize event is out of scope for us. Do nothing - return + return succeed(None) # Because the broker will drop session IDs already associated to scope # of the resynchronisation, it isn't safe to send messages until the === modified file 'landscape/monitor/usermonitor.py' --- landscape/monitor/usermonitor.py 2016-01-11 18:34:49 +0000 +++ landscape/monitor/usermonitor.py 2016-01-13 10:29:55 +0000 @@ -39,10 +39,14 @@ self._publisher.stop() self._publisher = None - def _reset(self): + def _resynchronize(self, scopes=None): """Reset user and group data.""" - super(UserMonitor, self)._reset() - return self._run_detect_changes() + deferred = super(UserMonitor, self)._resynchronize(scopes=scopes) + # Wait for the superclass' asynchronous _resynchronize method to + # complete, so we have a new session ID at hand and we can craft a + # valid message (l.broker.client.BrokerClientPlugin._resynchronize). + deferred.addCallback(lambda _: self._run_detect_changes()) + return deferred @remote def detect_changes(self, operation_id=None):