From 18d5d6aba31240f28bf507dffad39f73d2b118af Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Thu, 22 Oct 2015 14:36:30 +0800 Subject: [PATCH] Replace deprecated LOG.warn with LOG.warning Change-Id: Ib3d566f6e608ee453659e15cabcf8e9332aedc52 Closes-Bug: #1508442 --- ironic_python_agent/hardware.py | 8 ++++---- ironic_python_agent/inspector.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ironic_python_agent/hardware.py b/ironic_python_agent/hardware.py index 3cbcc2565..d755f8c85 100644 --- a/ironic_python_agent/hardware.py +++ b/ironic_python_agent/hardware.py @@ -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() diff --git a/ironic_python_agent/inspector.py b/ironic_python_agent/inspector.py index 49ddfc375..705e5200e 100644 --- a/ironic_python_agent/inspector.py +++ b/ironic_python_agent/inspector.py @@ -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'))