def update(self, entity):
"""Update an existing object from the data store.
Args:
entity (etcd.Result): An expanded result object that needs to be serialized
Returns:
etcd.Result: The resulting object expanded, or None if Etcd failed
"""
entity.value = json.dumps(entity.value)
try:
entity = self.client.update(entity)
except (etcd.EtcdCompareFailed, etcd.EtcdKeyNotFound):
return None
return self._load_from_etcd(entity)
评论列表
文章目录