summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghanshyam <ghanshyam.mann@nectechnologies.in>2016-04-21 17:19:06 +0900
committerJim Rollenhagen <jim@jimrollenhagen.com>2016-05-17 11:03:16 +0000
commite114c66400c52e7fb049f46aa87a49b99e279b9c (patch)
treea322b4e4cbbbebb653ca590f0676948ca5da83c1
parent9ea9169e162e05c37b6a614fc165680adb7a1987 (diff)
downloadironic-e114c66400c52e7fb049f46aa87a49b99e279b9c.tar.gz
Fix usage of rest_client expected_success() in tests
rest_client expected_success() method expect read_code must be int and states the same in doc string . Tempest is converting that to error instead of false pass. Details: I3f4c58bdbb172805514831103927d3464d65d7f3 Change-Id: Ic4b0af5701df99621e3abb693644c4824c92dc4c (cherry picked from commit e8dda1db0ef72da1d98bf238a6da986729a91e41)
-rw-r--r--ironic_tempest_plugin/services/baremetal/base.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/ironic_tempest_plugin/services/baremetal/base.py b/ironic_tempest_plugin/services/baremetal/base.py
index 5b6dea8fb..edb9ecbc7 100644
--- a/ironic_tempest_plugin/services/baremetal/base.py
+++ b/ironic_tempest_plugin/services/baremetal/base.py
@@ -110,7 +110,7 @@ class BaremetalClient(rest_client.RestClient):
uri += "?%s" % urllib.urlencode(kwargs)
resp, body = self.get(uri)
- self.expected_success(200, resp['status'])
+ self.expected_success(200, resp.status)
return resp, self.deserialize(body)
@@ -126,7 +126,7 @@ class BaremetalClient(rest_client.RestClient):
else:
uri = self._get_uri(resource, uuid=uuid, permanent=permanent)
resp, body = self.get(uri)
- self.expected_success(200, resp['status'])
+ self.expected_success(200, resp.status)
return resp, self.deserialize(body)
@@ -144,7 +144,7 @@ class BaremetalClient(rest_client.RestClient):
uri = self._get_uri(resource)
resp, body = self.post(uri, body=body)
- self.expected_success(201, resp['status'])
+ self.expected_success(201, resp.status)
return resp, self.deserialize(body)
@@ -159,7 +159,7 @@ class BaremetalClient(rest_client.RestClient):
uri = self._get_uri(resource, uuid)
resp, body = self.delete(uri)
- self.expected_success(204, resp['status'])
+ self.expected_success(204, resp.status)
return resp, body
def _patch_request(self, resource, uuid, patch_object):
@@ -175,7 +175,7 @@ class BaremetalClient(rest_client.RestClient):
patch_body = json.dumps(patch_object)
resp, body = self.patch(uri, body=patch_body)
- self.expected_success(200, resp['status'])
+ self.expected_success(200, resp.status)
return resp, self.deserialize(body)
@handle_errors
@@ -200,5 +200,5 @@ class BaremetalClient(rest_client.RestClient):
put_body = json.dumps(put_object)
resp, body = self.put(uri, body=put_body)
- self.expected_success(202, resp['status'])
+ self.expected_success([202, 204], resp.status)
return resp, body