~free.ekanayaka/landscape-client/use-smart-to-get-dpkg-arch

« back to all changes in this revision

Viewing changes to landscape/monitor/deployment.py

  • Committer: Thomas Hervé
  • Date: 2009-06-03 15:36:35 UTC
  • mfrom: (110.2.3 broker-restart)
  • Revision ID: thomas@canonical.com-20090603153635-wh7ucq6z10w8c857
Merge broker-restart [f=380633] [r=niemeyer,free.ekayanaka]

Make manager and monitor plugins registered themselves and the mesage types
again if the broker is restarted. The notification happens with a new signal
sent by the broker at start.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
 
69
69
        # If this raises ServiceUnknownError, we should do something nice.
70
70
        self.remote_broker = RemoteBroker(self.bus)
 
71
 
71
72
        self.registry = MonitorPluginRegistry(self.remote_broker, self.reactor,
72
73
                                              self.config, self.bus,
73
74
                                              self.persist,
74
75
                                              self.persist_filename)
75
76
        self.dbus_service = MonitorDBusObject(self.bus, self.registry)
76
77
        DBusSignalToReactorTransmitter(self.bus, self.reactor)
77
 
        self.remote_broker.register_plugin(self.dbus_service.bus_name,
78
 
                                           self.dbus_service.object_path)
79
78
 
80
79
        for plugin in self.plugins:
81
80
            self.registry.add(plugin)
83
82
        self.flush_call_id = self.reactor.call_every(
84
83
            self.config.flush_interval, self.registry.flush)
85
84
 
 
85
        def broker_started():
 
86
            self.remote_broker.register_plugin(self.dbus_service.bus_name,
 
87
                                               self.dbus_service.object_path)
 
88
            self.registry.broker_started()
 
89
 
 
90
        broker_started()
 
91
        self.bus.add_signal_receiver(broker_started, "broker_started")
 
92
 
86
93
    def stopService(self):
87
94
        """Stop the monitor.
88
95