Merge "Fix log message for exception in Gen7"
This commit is contained in:
@@ -119,8 +119,7 @@ class RIBCLOperations(operations.IloOperations):
|
||||
response = requests.post(urlstr, **kwargs)
|
||||
response.raise_for_status()
|
||||
except Exception as e:
|
||||
LOG.exception(self._("An error occurred while "
|
||||
"contacting iLO. Error: %s"), e)
|
||||
LOG.debug(self._("Unable to connect to iLO. %s"), e)
|
||||
raise exception.IloConnectionError(e)
|
||||
return response.text
|
||||
|
||||
@@ -278,24 +277,24 @@ class RIBCLOperations(operations.IloOperations):
|
||||
platform = self.get_product_name()
|
||||
msg = ("%(cmd)s is not supported on %(platform)s" %
|
||||
{'cmd': cmd, 'platform': platform})
|
||||
LOG.error(self._("Got invalid response with "
|
||||
LOG.debug(self._("Got invalid response with "
|
||||
"message: '%(message)s'"),
|
||||
{'message': msg})
|
||||
raise (exception.IloCommandNotSupportedError
|
||||
(msg, status))
|
||||
else:
|
||||
LOG.error(self._("Got invalid response with "
|
||||
LOG.debug(self._("Got invalid response with "
|
||||
"message: '%(message)s'"),
|
||||
{'message': msg})
|
||||
raise exception.IloClientInternalError(msg, status)
|
||||
if (status in exception.IloLoginFailError.statuses or
|
||||
msg in exception.IloLoginFailError.messages):
|
||||
LOG.error(self._("Got invalid response with "
|
||||
LOG.debug(self._("Got invalid response with "
|
||||
"message: '%(message)s'"),
|
||||
{'message': msg})
|
||||
raise exception.IloLoginFailError(msg, status)
|
||||
|
||||
LOG.error(self._("Got invalid response with "
|
||||
LOG.debug(self._("Got invalid response with "
|
||||
"message: '%(message)s'"),
|
||||
{'message': msg})
|
||||
raise exception.IloError(msg, status)
|
||||
|
||||
@@ -120,8 +120,7 @@ class RISOperations(operations.IloOperations):
|
||||
try:
|
||||
response = request_method(url.geturl(), **kwargs)
|
||||
except Exception as e:
|
||||
LOG.exception(self._("An error occurred while "
|
||||
"contacting iLO. Error: %s"), e)
|
||||
LOG.debug(self._("Unable to connect to iLO. %s"), e)
|
||||
raise exception.IloConnectionError(e)
|
||||
|
||||
# NOTE:Do not assume every HTTP operation will return a JSON body.
|
||||
@@ -142,9 +141,9 @@ class RISOperations(operations.IloOperations):
|
||||
else:
|
||||
# Redirected for 5th time. Throw error
|
||||
msg = (self._("URL Redirected 5 times continuously. "
|
||||
"URL incorrect: %(start_url)s") %
|
||||
"URL used: %(start_url)s") %
|
||||
{'start_url': start_url})
|
||||
LOG.error(msg)
|
||||
LOG.debug(msg)
|
||||
raise exception.IloConnectionError(msg)
|
||||
|
||||
response_body = {}
|
||||
@@ -167,7 +166,7 @@ class RISOperations(operations.IloOperations):
|
||||
uncompressed_string = gzipper.read().decode('UTF-8')
|
||||
response_body = json.loads(uncompressed_string)
|
||||
except Exception as e:
|
||||
LOG.error(self._("Got invalid response "
|
||||
LOG.debug(self._("Got invalid response "
|
||||
"'%(response)s' for url %(url)s."),
|
||||
{'url': url.geturl(),
|
||||
'response': response.text})
|
||||
@@ -1562,8 +1561,8 @@ class RISOperations(operations.IloOperations):
|
||||
return
|
||||
|
||||
if state == "ERROR":
|
||||
msg = 'Error in firmware update'
|
||||
LOG.error(self._(msg)) # noqa
|
||||
msg = 'Unable to update firmware'
|
||||
LOG.debug(self._(msg)) # noqa
|
||||
raise exception.IloError(msg)
|
||||
elif state == "UNKNOWN":
|
||||
msg = 'Status of firmware update not known'
|
||||
|
||||
Reference in New Issue
Block a user