64099c8cd0c6c54dd2ba2cd567269a6e636b7962
[osm/N2VC.git] / juju / client / watcher.py
1 from .client import AllWatcherFacade as BaseAllWatcher
2 from .client import ClientFacade
3
4
5 class AllWatcher(BaseAllWatcher):
6 async def rpc(self, msg):
7 if not hasattr(self, 'Id'):
8 client = ClientFacade()
9 client.connect(self.connection)
10
11 result = await client.WatchAll()
12 self.Id = result.watcher_id
13
14 msg['Id'] = self.Id
15 return await super(AllWatcher, self).rpc(msg)