Loading cloudcontrol/server/clients/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -227,7 +227,7 @@ class Client(object): """ Asynchronously update tags from the remote client using specified watcher. """ watcher.register(self.conn, 'get_tags', tags, _data=robj) watcher.register(self.conn, 'get_tags', tags, _data=(tags, robj)) def tags_register(self, name, ttl=None, value=None): """ Register a new remote tag for the client. Loading cloudcontrol/server/clients/hv.py +1 −1 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ class HvClient(HostClient): """ Asynchronously update sub tags from the remote client using specified watcher. """ watcher.register(self.conn, 'sub_tags', obj_id, tags, _data=robj) watcher.register(self.conn, 'sub_tags', obj_id, tags, _data=(tags, robj)) Client.register_client_class(HvClient) cloudcontrol/server/db.py +13 −6 Original line number Diff line number Diff line Loading @@ -159,10 +159,17 @@ class SRequestor(StaticRequestor): cb = tuple(to_update)[0].callback cb(watcher, obj, [t.name for t in to_update]) # Get and process the results: for update in watcher.wait(timeout=10): #TODO: adaptative timeout obj = update['data'] for update in watcher.iter(timeout=10, raise_timeout=True): #TODO: adaptative timeout requested_tags, obj = update['data'] if 'return' not in update: continue #TODO: display error in tag value for tag_name, tag_value in update['return'].iteritems(): for tag_name in requested_tags: obj.set(tag_name, '#ERR#') else: tags = update['return'] for tag_name in requested_tags: tag_value = tags.get(tag_name) if tag_value is None: obj.set(tag_name, '#ERR') else: obj.set(tag_name, tag_value) obj[tag_name].cached = tag_value # Set the tag cache value Loading
cloudcontrol/server/clients/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -227,7 +227,7 @@ class Client(object): """ Asynchronously update tags from the remote client using specified watcher. """ watcher.register(self.conn, 'get_tags', tags, _data=robj) watcher.register(self.conn, 'get_tags', tags, _data=(tags, robj)) def tags_register(self, name, ttl=None, value=None): """ Register a new remote tag for the client. Loading
cloudcontrol/server/clients/hv.py +1 −1 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ class HvClient(HostClient): """ Asynchronously update sub tags from the remote client using specified watcher. """ watcher.register(self.conn, 'sub_tags', obj_id, tags, _data=robj) watcher.register(self.conn, 'sub_tags', obj_id, tags, _data=(tags, robj)) Client.register_client_class(HvClient)
cloudcontrol/server/db.py +13 −6 Original line number Diff line number Diff line Loading @@ -159,10 +159,17 @@ class SRequestor(StaticRequestor): cb = tuple(to_update)[0].callback cb(watcher, obj, [t.name for t in to_update]) # Get and process the results: for update in watcher.wait(timeout=10): #TODO: adaptative timeout obj = update['data'] for update in watcher.iter(timeout=10, raise_timeout=True): #TODO: adaptative timeout requested_tags, obj = update['data'] if 'return' not in update: continue #TODO: display error in tag value for tag_name, tag_value in update['return'].iteritems(): for tag_name in requested_tags: obj.set(tag_name, '#ERR#') else: tags = update['return'] for tag_name in requested_tags: tag_value = tags.get(tag_name) if tag_value is None: obj.set(tag_name, '#ERR') else: obj.set(tag_name, tag_value) obj[tag_name].cached = tag_value # Set the tag cache value