Update log level of session related logs

In api, session recreation log messages are at WARN level which
can confuse administrators. These messages indicate nothing
unusual and should be at debug level.  VIM error while checking
active session within an expired session is also normal and
shouldn't raise a warning.

This patch fixes the log level of these messages.

Change-Id: Ia5f81c20890973888f90a99e87e71cd18e8dd24b
This commit is contained in:
Vipin Balachandran 2015-07-01 17:14:37 +05:30 committed by Davanum Srinivas (dims)
parent a1a6393990
commit 60565f4dcc

View File

@ -309,7 +309,7 @@ class VMwareAPISession(object):
{'session': _trunc_id(self._session_id),
'module': module,
'method': method})
LOG.warn(excep_msg, exc_info=True)
LOG.debug(excep_msg)
self._create_session()
raise exceptions.VimConnectionException(excep_msg,
excep)
@ -332,12 +332,11 @@ class VMwareAPISession(object):
# if the session has expired. Otherwise, it could be
# a transient issue.
if not self.is_current_session_active():
LOG.warn(_LW("Re-creating session due to connection "
"problems while invoking method "
"%(module)s.%(method)s."),
{'module': module,
'method': method},
exc_info=True)
LOG.debug("Re-creating session due to connection "
"problems while invoking method "
"%(module)s.%(method)s.",
{'module': module,
'method': method})
self._create_session()
return _invoke_api(module, method, *args, **kwargs)
@ -356,11 +355,11 @@ class VMwareAPISession(object):
self.vim.service_content.sessionManager,
sessionID=self._session_id,
userName=self._session_username)
except exceptions.VimException:
LOG.warn(_LW("Error occurred while checking whether the "
"current session: %s is active."),
_trunc_id(self._session_id),
exc_info=True)
except exceptions.VimException as ex:
LOG.debug("Error: %(error)s occurred while checking whether the "
"current session: %(session)s is active.",
{'error': six.text_type(ex),
'session': _trunc_id(self._session_id)})
return is_active