Repository: cloudstack-cloudmonkey Updated Branches: refs/heads/master 3023ace5f -> a78a0d20e
cloudmonkey: send better error messages if none if sent in headers Signed-off-by: Rohit Yadav <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/commit/a78a0d20 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/a78a0d20 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/a78a0d20 Branch: refs/heads/master Commit: a78a0d20e2eb844126fb63e406f8ae2ca0ea4d53 Parents: 3023ace Author: Rohit Yadav <[email protected]> Authored: Fri May 22 10:18:53 2015 +0100 Committer: Rohit Yadav <[email protected]> Committed: Fri May 22 10:18:53 2015 +0100 ---------------------------------------------------------------------- cloudmonkey/requester.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/a78a0d20/cloudmonkey/requester.py ---------------------------------------------------------------------- diff --git a/cloudmonkey/requester.py b/cloudmonkey/requester.py index 6b8c041..b01aa5c 100644 --- a/cloudmonkey/requester.py +++ b/cloudmonkey/requester.py @@ -148,8 +148,10 @@ def make_request_with_password(command, args, logger, url, credentials, continue if resp.status_code != 200 and resp.status_code != 401: - error = "{0}: {1}".format(resp.status_code, - resp.headers.get('X-Description')) + error_message = resp.headers.get('X-Description') + if not error_message: + error_message = resp.text + error = "{0}: {1}".format(resp.status_code, error_message) result = None retry = False
