-
Notifications
You must be signed in to change notification settings - Fork 183
store() fails if object does not exist #17
Copy link
Copy link
Closed
Description
If I try to update a key that did not exist, I get an error when trying to store that object:
>>> import riak
>>> c = riak.RiakClient(port=8091)
>>> b = c.bucket("test")
>>> o = b.get("foo")
>>> o.exists()
False
>>> o.set_data({"foo": "bar"})
<riak.riak_object.RiakObject object at 0x100676950>
>>> o.store()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/emoritz/Projects/riak/riak-python-client/riak/riak_object.py", line 269, in store
Result = t.put(self, w, dw, return_body)
File "/Users/emoritz/Projects/riak/riak-python-client/riak/transports/http.py", line 100, in put
'Content-Type' : robj.get_content_type(),
File "/Users/emoritz/Projects/riak/riak-python-client/riak/riak_object.py", line 172, in get_content_type
return self._metadata[MD_CTYPE]
KeyError: 'content-type'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels