Skip to content

Commit 985118f

Browse files
committed
client.write(): only send value param if value is actually set.
`client.update()` calls to directories were failing because the client sends and empty `value` param with every `client.write()` call. This only sends a `value` param in `client.write()` if `value` is set, which fixes this.
1 parent 232ce2a commit 985118f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/etcd/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ def write(self, key, value, ttl=None, dir=False, append=False, **kwdargs):
240240
241241
"""
242242
key = self._sanitize_key(key)
243-
params = {
244-
'value': value
245-
}
243+
params = {}
244+
if value:
245+
params['value'] = value
246246

247247
if ttl:
248248
params['ttl'] = ttl

0 commit comments

Comments
 (0)