Python 3 deprecated the logger.warn method in favor of warning

Python 3 deprecated the logger.warn method, see:
https://docs.python.org/3/library/logging.html#logging.warning, so we
prefer to use warning to avoid DeprecationWarning.

Change-Id: Ic4e07276def17ef39764601c8a7e0991f9a4efbc
Closes-Bug: 1508442
This commit is contained in:
Wanlong Gao 2015-12-29 14:37:10 +08:00
parent a5a5b3fd61
commit 2fde87a0e9
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ def validate_source(data):
if not exists:
if data.get('optional'):
LOG.warn("%s does not exist, but is not required", source)
LOG.warning("%s does not exist, but is not required", source)
return False
else:
LOG.error("The source to copy does not exist: %s", source)

View File

@ -37,7 +37,7 @@ class OpenStackClients(object):
return connected_client
except StopIteration:
LOG.warn("Requested client %s not found", name)
LOG.warning("Requested client %s not found", name)
raise
def create(self):