def update_zun_service(self, host, binary, values):
try:
target = self.client.read('/zun_services/' + host + '_' + binary)
target_value = json.loads(target.value)
values['updated_at'] = datetime.isoformat(timeutils.utcnow())
target_value.update(values)
target.value = json.dump_as_bytes(target_value)
self.client.update(target)
except etcd.EtcdKeyNotFound:
raise exception.ZunServiceNotFound(host=host, binary=binary)
except Exception as e:
LOG.error('Error occurred while updating service: %s',
six.text_type(e))
raise
评论列表
文章目录