jplana / python-etcd

A python client for etcd
Other
520 stars 210 forks source link

prevValue does not compare multi-attribute json #197

Closed scheetz closed 7 years ago

scheetz commented 8 years ago

test_and_set(key, value, value)

Compare failed : [{"apiVersion":"v1","kind":"Endpoints","metadata":{"creationTimestamp":"2016-09-01T22:57:56Z","name":"kubernetes","namespace":"default","uid":"85c41ccb-7097-11e6-aea4-080027a1460e"},"subsets":[{"addresses":[{"ip":"192.168.55.40"},{"ip":"192.168.55.42"}],"ports":[{"name":"https","port":6443,"protocol":"TCP"}]}]} != {"kind":"Endpoints","apiVersion":"v1","metadata":{"name":"kubernetes","namespace":"default","uid":"85c41ccb-7097-11e6-aea4-080027a1460e","creationTimestamp":"2016-09-01T22:57:56Z"},"subsets":[{"addresses":[{"ip":"192.168.55.40"},{"ip":"192.168.55.42"}],"ports":[{"name":"https","port":6443,"protocol":"TCP"}]}]}

The value was fetched, decrypted and encrypted with json module.

It will compare correctly if the value is fetched and compared without running through json en/decrypt.

lavagetto commented 7 years ago

I have no idea of how to understand if this is a bug of python-etcd with this amount of information.

Please provide a better description with a code snippet.