bare_metal.update_node(id, **kwargs) produces invalid requests

Bug #1668767 reported by Justin Kilpatrick
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack SDK
New
Undecided
Unassigned

Bug Description

conn.bare_metal.update_node(uuid, name="test")

Fails, despite name being a totally valid attribute to update and uuid being a valid ironic uuid. This should be really easy to reproduce, I've run into it on two different clouds now so I'm pretty sure it's a bug.

Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 764, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/stack/browbeat-venv/lib/python2.7/site-packages/ostag/lib/Tools.py", line 83, in tag_node
    conn.bare_metal.update_node(uuid, name="test")
  File "/home/stack/browbeat-venv/lib/python2.7/site-packages/openstack/bare_metal/v1/_proxy.py", line 240, in update_node
    return self._update(_node.Node, node, **attrs)
  File "/home/stack/browbeat-venv/lib/python2.7/site-packages/openstack/proxy2.py", line 36, in check
    return method(self, expected, actual, *args, **kwargs)
  File "/home/stack/browbeat-venv/lib/python2.7/site-packages/openstack/proxy2.py", line 173, in _update
    return res.update(self.session)
  File "/home/stack/browbeat-venv/lib/python2.7/site-packages/openstack/resource2.py", line 660, in update
    headers=request.headers)
  File "/home/stack/browbeat-venv/lib/python2.7/site-packages/keystoneauth1/session.py", line 790, in patch
    return self.request(url, 'PATCH', **kwargs)
  File "/home/stack/browbeat-venv/lib/python2.7/site-packages/openstack/session.py", line 66, in map_exceptions_wrapper
    raise exceptions.from_exception(e)
  File "/home/stack/browbeat-venv/lib/python2.7/site-packages/openstack/exceptions.py", line 128, in from_exception
    messages = [obj.get('message') for obj in resp.json().values()]
AttributeError: 'unicode' object has no attribute 'get'

2017-02-28 19:54:33,881 DEBUG: keystoneauth.session REQ: curl -g -i -X PATCH http://192.0.2.1:6385/v1/nodes/ad48b305-5522-4432-bc15-5afd8c081c15 -H "User-Agent: openstacksdk/0.9.13 keystoneauth1/2.18.0 python-requests/2.13.0 CPython/2.7.5" -H "Content-Type: application/json" -H "X-Auth-Token: {SHA1}0fe146e7c130a3ec395e54ac65dcfbdc921dbba8" -d '{"name": "test", "uuid": "ad48b305-5522-4432-bc15-5afd8c081c15"}'
2017-02-28 19:54:33,889 DEBUG: keystoneauth.session RESP: [400] X-Openstack-Ironic-Api-Minimum-Version: 1.1 X-Openstack-Ironic-Api-Maximum-Version: 1.22 X-Openstack-Ironic-Api-Version: 1.1 Openstack-Request-Id: req-7130344f-14a5-41d2-96ab-16bd245519a9 Content-Type: application/json Content-Length: 296 Date: Tue, 28 Feb 2017 19:54:33 GMT Connection: keep-alive
RESP BODY: {"error_message": "{\"debuginfo\": null, \"faultcode\": \"Client\", \"faultstring\": \"Invalid input for field/attribute patch. Value: '{'name': 'test', 'uuid': 'ad48b305-5522-4432-bc15-5afd8c081c15'}'. Value not a valid list: {'name': 'test', 'uuid': 'ad48b305-5522-4432-bc15-5afd8c081c15'}\"}"}

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.