jplana / python-etcd

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

client.write can't create dir #241

Closed WanzyShu closed 7 years ago

WanzyShu commented 7 years ago

client.write("/test/ni", dir=True) can't create dir

because the "write" method required "value" field, and has "value" field will raise Exception: Traceback (most recent call last): File "", line 1, in TypeError: write() takes at least 3 arguments (3 given)

pls fix it

WanzyShu commented 7 years ago

And give value field, always has Exception:

etcd.write('/nodes/queue', "1",dir=True) Traceback (most recent call last): File "", line 1, in File "/Users/shujian/project/tw_collection/.venv/lib/python2.7/site-packages/etcd/client.py", line 484, in write 'Cannot create a directory with a value') EtcdException: Cannot create a directory with a value

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 88.212% when pulling 388983471fb42d75a5ba903947ba7b2b066b276c on WanzyShu:master into 18c75196ffd04b3104f3ba44356ec1fcbcc4d09a on jplana:master.

lavagetto commented 7 years ago

You can create a directory by passing a value of None explicitly. It was preferred as we want people to be forced to pass a value in general.