Replace deprecated LOG.warn with LOG.warning
Change-Id: Ib3d566f6e608ee453659e15cabcf8e9332aedc52 Closes-Bug: #1508442
This commit is contained in:
@@ -399,7 +399,7 @@ class GenericHardwareManager(HardwareManager):
|
|||||||
out, _e = utils.execute("dmidecode --type memory | grep Size",
|
out, _e = utils.execute("dmidecode --type memory | grep Size",
|
||||||
shell=True)
|
shell=True)
|
||||||
except (processutils.ProcessExecutionError, OSError) as e:
|
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
|
physical = None
|
||||||
else:
|
else:
|
||||||
physical = 0
|
physical = 0
|
||||||
@@ -416,8 +416,8 @@ class GenericHardwareManager(HardwareManager):
|
|||||||
line, exc)
|
line, exc)
|
||||||
|
|
||||||
if not physical:
|
if not physical:
|
||||||
LOG.warn('failed to get real physical RAM, dmidecode returned '
|
LOG.warning('failed to get real physical RAM, dmidecode '
|
||||||
'%s', out)
|
'returned %s', out)
|
||||||
|
|
||||||
return Memory(total=total, physical_mb=physical)
|
return Memory(total=total, physical_mb=physical)
|
||||||
|
|
||||||
@@ -601,7 +601,7 @@ class GenericHardwareManager(HardwareManager):
|
|||||||
"| awk '{ print $4 }'", shell=True)
|
"| awk '{ print $4 }'", shell=True)
|
||||||
except (processutils.ProcessExecutionError, OSError) as e:
|
except (processutils.ProcessExecutionError, OSError) as e:
|
||||||
# Not error, because it's normal in virtual environment
|
# 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
|
||||||
|
|
||||||
return out.strip()
|
return out.strip()
|
||||||
|
|||||||
@@ -207,8 +207,8 @@ def discover_scheduling_properties(inventory, data, root_disk=None):
|
|||||||
try:
|
try:
|
||||||
data[key] = int(data[key])
|
data[key] = int(data[key])
|
||||||
except (KeyError, ValueError, TypeError):
|
except (KeyError, ValueError, TypeError):
|
||||||
LOG.warn('value for %s is missing or malformed: %s',
|
LOG.warning('value for %s is missing or malformed: %s',
|
||||||
key, data.get(key))
|
key, data.get(key))
|
||||||
else:
|
else:
|
||||||
LOG.info('value for %s is %s', key, data[key])
|
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'][:])
|
root_disk = utils.guess_root_disk(inventory['disks'][:])
|
||||||
except errors.DeviceNotFound:
|
except errors.DeviceNotFound:
|
||||||
root_disk = None
|
root_disk = None
|
||||||
LOG.warn('no suitable root device detected')
|
LOG.warning('no suitable root device detected')
|
||||||
else:
|
else:
|
||||||
data['root_disk'] = root_disk
|
data['root_disk'] = root_disk
|
||||||
LOG.debug('default root device is %s', root_disk.name)
|
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',
|
out, _e = utils.execute('journalctl', '--full', '--no-pager', '-b',
|
||||||
'-n', '10000')
|
'-n', '10000')
|
||||||
except (processutils.ProcessExecutionError, OSError):
|
except (processutils.ProcessExecutionError, OSError):
|
||||||
LOG.warn('failed to get system journal')
|
LOG.warning('failed to get system journal')
|
||||||
return
|
return
|
||||||
|
|
||||||
journal = io.BytesIO(out.encode('utf-8'))
|
journal = io.BytesIO(out.encode('utf-8'))
|
||||||
|
|||||||
Reference in New Issue
Block a user