Replace deprecated LOG.warn with LOG.warning

Change-Id: Ib3d566f6e608ee453659e15cabcf8e9332aedc52
Closes-Bug: #1508442
This commit is contained in:
Zhenguo Niu 2015-10-22 14:36:30 +08:00
parent f042be51f4
commit 18d5d6aba3
2 changed files with 8 additions and 8 deletions

View File

@ -399,7 +399,7 @@ class GenericHardwareManager(HardwareManager):
out, _e = utils.execute("dmidecode --type memory | grep Size",
shell=True)
except (processutils.ProcessExecutionError, OSError) as e:
LOG.warn("Cannot get real physical memory size: %s", e)
LOG.warning("Cannot get real physical memory size: %s", e)
physical = None
else:
physical = 0
@ -416,8 +416,8 @@ class GenericHardwareManager(HardwareManager):
line, exc)
if not physical:
LOG.warn('failed to get real physical RAM, dmidecode returned '
'%s', out)
LOG.warning('failed to get real physical RAM, dmidecode '
'returned %s', out)
return Memory(total=total, physical_mb=physical)
@ -601,7 +601,7 @@ class GenericHardwareManager(HardwareManager):
"| awk '{ print $4 }'", shell=True)
except (processutils.ProcessExecutionError, OSError) as e:
# Not error, because it's normal in virtual environment
LOG.warn("Cannot get BMC address: %s", e)
LOG.warning("Cannot get BMC address: %s", e)
return
return out.strip()

View File

@ -207,8 +207,8 @@ def discover_scheduling_properties(inventory, data, root_disk=None):
try:
data[key] = int(data[key])
except (KeyError, ValueError, TypeError):
LOG.warn('value for %s is missing or malformed: %s',
key, data.get(key))
LOG.warning('value for %s is missing or malformed: %s',
key, data.get(key))
else:
LOG.info('value for %s is %s', key, data[key])
@ -240,7 +240,7 @@ def collect_default(data, failures):
root_disk = utils.guess_root_disk(inventory['disks'][:])
except errors.DeviceNotFound:
root_disk = None
LOG.warn('no suitable root device detected')
LOG.warning('no suitable root device detected')
else:
data['root_disk'] = root_disk
LOG.debug('default root device is %s', root_disk.name)
@ -276,7 +276,7 @@ def collect_logs(data, failures):
out, _e = utils.execute('journalctl', '--full', '--no-pager', '-b',
'-n', '10000')
except (processutils.ProcessExecutionError, OSError):
LOG.warn('failed to get system journal')
LOG.warning('failed to get system journal')
return
journal = io.BytesIO(out.encode('utf-8'))