Merge "py33: 'dict_keys' object does not support indexing"
This commit is contained in:
commit
935e1fe167
novaclient
@ -206,7 +206,7 @@ def from_response(response, body, url, method=None):
|
|||||||
details = "n/a"
|
details = "n/a"
|
||||||
|
|
||||||
if hasattr(body, 'keys'):
|
if hasattr(body, 'keys'):
|
||||||
error = body[body.keys()[0]]
|
error = body[list(body)[0]]
|
||||||
message = error.get('message', None)
|
message = error.get('message', None)
|
||||||
details = error.get('details', None)
|
details = error.get('details', None)
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ class FakeHTTPClient(fakes.FakeHTTPClient):
|
|||||||
|
|
||||||
def post_os_baremetal_nodes_1_action(self, **kw):
|
def post_os_baremetal_nodes_1_action(self, **kw):
|
||||||
body = kw['body']
|
body = kw['body']
|
||||||
action = body.keys()[0]
|
action = list(body)[0]
|
||||||
if action == "add_interface":
|
if action == "add_interface":
|
||||||
return (
|
return (
|
||||||
200, {}, {
|
200, {}, {
|
||||||
|
@ -488,7 +488,7 @@ class FakeHTTPClient(base_client.HTTPClient):
|
|||||||
_body = None
|
_body = None
|
||||||
resp = 202
|
resp = 202
|
||||||
assert len(body.keys()) == 1
|
assert len(body.keys()) == 1
|
||||||
action = body.keys()[0]
|
action = list(body)[0]
|
||||||
if action == 'reboot':
|
if action == 'reboot':
|
||||||
assert body[action].keys() == ['type']
|
assert body[action].keys() == ['type']
|
||||||
assert body[action]['type'] in ['HARD', 'SOFT']
|
assert body[action]['type'] in ['HARD', 'SOFT']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user