Merge "Modified _parse_resp_body in Compute Exception Handler"

This commit is contained in:
Jenkins 2015-05-12 16:32:08 +00:00 committed by Gerrit Code Review
commit 74a338ce01

View File

@ -110,7 +110,7 @@ class ExceptionHandler:
try:
element = ET.fromstring(resp_body)
# Handle the case where the API returns the exception in HTML
AutoMarshallingModel._remove_namespace(element, ns)
AutoMarshallingModel._remove_xml_etree_namespace(element, ns)
type = 'xml'
return ({element.tag: {'message': element.find('message').text}},
type)
@ -118,7 +118,6 @@ class ExceptionHandler:
pass
# Parse as HTML
finally:
split_resp = resp_body.split("\n\n")
type = 'html'
return {split_resp[0]: {'message': split_resp[1]}}, type
split_resp = resp_body.split("\n\n")
type = 'html'
return {split_resp[0]: {'message': split_resp[1]}}, type