Make resp_body optional on RestClientException

The commit Ie1bb259e7e683081f0ad127617acc8deb98467c0 adds resp_body
to RestClientException, but it broke some unit tests of Tempest
because NotFound calls don't pass the resp_body.
So the above commit was backwards incompatible changes, this patch
makes resp_body optional for avoiding affecting to the other projects.

Change-Id: Ic75f0673f27fb23c2784f2f8dbceab70061d3823
This commit is contained in:
Ken'ichi Ohmichi
2015-06-24 00:46:48 +00:00
parent 8f67d9f38b
commit 31662cad4e

View File

@@ -47,7 +47,7 @@ class TempestException(Exception):
class RestClientException(TempestException,
testtools.TestCase.failureException):
def __init__(self, resp_body, *args, **kwargs):
def __init__(self, resp_body=None, *args, **kwargs):
self.resp_body = resp_body
message = kwargs.get("message", resp_body)
super(RestClientException, self).__init__(message, *args, **kwargs)