Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to get the etcd revision from puts and transaction transaction puts #406

Open
dementedhedgehog opened this issue Apr 19, 2018 · 0 comments

Comments

@dementedhedgehog
Copy link

dementedhedgehog commented Apr 19, 2018

We want to check the whole etcd hasn't changed, for reasons... Would it be cool to return them instead of None, something like the following:

diff --git a/etcd3/client.py b/etcd3/client.py
index 662d125..55a85df 100644
--- a/etcd3/client.py
+++ b/etcd3/client.py
@@ -346,12 +346,13 @@ class Etcd3Client(object):
         :type lease: either :class:`.Lease`, or int (ID of lease)
         """
         put_request = self._build_put_request(key, value, lease=lease)
-        self.kvstub.Put(
+        meta_data = self.kvstub.Put(
             put_request,
             self.timeout,
             credentials=self.call_credentials,
             metadata=self.metadata
         )
+        return (True, meta_data)
 
     @_handle_errors
     def replace(self, key, initial_value, new_value):
@@ -644,7 +645,7 @@ class Etcd3Client(object):
         for response in txn_response.responses:
             response_type = response.WhichOneof('response')
             if response_type == 'response_put':
-                responses.append(None)
+                responses.append(response)
 
             elif response_type == 'response_range':
                 range_kvs = []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant