Change LOG.warn to LOG.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: I2d71a52f6c86bc2def2c3abd0750236a86ccc6cf
Closes-Bug: #1530742
This commit is contained in:
zhangguoqing 2016-01-04 12:53:50 +00:00
parent 7f05a9745f
commit 936773daa1
1 changed files with 4 additions and 4 deletions

View File

@ -151,10 +151,10 @@ class PowerVMInspector(virt_inspector.Inspector):
# the CPU utilization within the last X seconds...because to THIS
# host its new (only in the cur_metric). So we error out, the
# inspector will use a debug message in the log.
LOG.warn(_LW("Unable to derive CPU Utilization for VM %s. It is "
"either a new VM or was recently migrated. It will "
"be collected in the next inspection cycle."),
instance.name)
LOG.warning(_LW("Unable to derive CPU Utilization for VM %s. "
"It is either a new VM or was recently migrated. "
"It will be collected in the next inspection "
"cycle."), instance.name)
message = (_("Unable to derive CPU Utilization for VM %s.") %
instance.name)
raise virt_inspector.InstanceNotFoundException(message)