Replace deprecated LOG.warn with LOG.warning

Closes-Bug: #1508442
Change-Id: Ifcc2004f3274808d868c9947ed2b0b484f815daa
This commit is contained in:
Zhenguo Niu 2015-10-22 14:12:03 +08:00
parent 4899c9ab93
commit bcd8d5dfa0
5 changed files with 20 additions and 15 deletions

View File

@ -71,8 +71,8 @@ def init():
subprocess.check_call(BASE_COMMAND + ('-w', '-h'),
stderr=null, stdout=null)
except subprocess.CalledProcessError:
LOG.warn(_LW('iptables does not support -w flag, please update '
'it to at least version 1.4.21'))
LOG.warning(_LW('iptables does not support -w flag, please update '
'it to at least version 1.4.21'))
else:
BASE_COMMAND += ('-w',)

View File

@ -165,8 +165,9 @@ class NodeInfo(object):
if mac not in self.ports():
self._create_port(mac)
else:
LOG.warn(_LW('Port %(mac)s already exists for node %(uuid)s, '
'skipping'), {'mac': mac, 'uuid': self.uuid})
LOG.warning(
_LW('Port %(mac)s already exists for node %(uuid)s, '
'skipping'), {'mac': mac, 'uuid': self.uuid})
def ports(self):
"""Get Ironic port objects associated with the cached node record.
@ -184,8 +185,9 @@ class NodeInfo(object):
try:
port = self.ironic.port.create(node_uuid=self.uuid, address=mac)
except exceptions.Conflict:
LOG.warn(_LW('Port %(mac)s already exists for node %(uuid)s, '
'skipping'), {'mac': mac, 'uuid': self.uuid})
LOG.warning(
_LW('Port %(mac)s already exists for node %(uuid)s, '
'skipping'), {'mac': mac, 'uuid': self.uuid})
# NOTE(dtantsur): we didn't get port object back, so we have to
# reload ports on next access
self._ports = None
@ -328,8 +330,9 @@ def delete_nodes_not_in_list(uuids):
"""
inspector_uuids = _list_node_uuids()
for uuid in inspector_uuids - uuids:
LOG.warn(_LW('Node %s was deleted from Ironic, dropping from Ironic '
'Inspector database'), uuid)
LOG.warning(
_LW('Node %s was deleted from Ironic, dropping from Ironic '
'Inspector database'), uuid)
_delete_node(uuid)

View File

@ -231,9 +231,10 @@ class RamdiskErrorHook(base.ProcessingHook):
def _store_logs(self, logs, introspection_data):
if not CONF.processing.ramdisk_logs_dir:
LOG.warn(_LW('Failed to store logs received from the ramdisk '
'because ramdisk_logs_dir configuration option '
'is not set'))
LOG.warning(
_LW('Failed to store logs received from the ramdisk '
'because ramdisk_logs_dir configuration option '
'is not set'))
return
if not os.path.exists(CONF.processing.ramdisk_logs_dir):

View File

@ -131,11 +131,11 @@ def _run_post_hooks(node_info, introspection_data):
node_patches=node_patches,
ports_patches=ports_patches)
if node_patches:
LOG.warn(_LW('Using node_patches is deprecated'))
LOG.warning(_LW('Using node_patches is deprecated'))
node_info.patch(node_patches)
if ports_patches:
LOG.warn(_LW('Using ports_patches is deprecated'))
LOG.warning(_LW('Using ports_patches is deprecated'))
for mac, patches in ports_patches.items():
node_info.patch_port(mac, patches)

View File

@ -174,8 +174,9 @@ def get_ipmi_address(node):
def check_provision_state(node, with_credentials=False):
if node.maintenance:
LOG.warn(_LW('Introspecting nodes in maintenance mode is deprecated, '
'accepted states: %s'), VALID_STATES)
LOG.warning(
_LW('Introspecting nodes in maintenance mode is deprecated, '
'accepted states: %s'), VALID_STATES)
return
state = node.provision_state.lower()