From 18265edfc4e1d3aa79e0b97b2997f81c16b3f60e Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 19 Jan 2022 13:40:47 +0900 Subject: [PATCH] Use LOG.warning instead of deprecated LOG.warn The LOG.warn method is deprecated[1] and the LOG.warning method should be used instead. [1] https://docs.python.org/3/library/logging.html#logging.warning Change-Id: Id77bef0ad9e2dd045f016a9dda55bba6badb6df3 --- .../os_tripleo_baremetal_node_introspection.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tripleo_ansible/ansible_plugins/modules/os_tripleo_baremetal_node_introspection.py b/tripleo_ansible/ansible_plugins/modules/os_tripleo_baremetal_node_introspection.py index a0227bf93..1207e81a8 100644 --- a/tripleo_ansible/ansible_plugins/modules/os_tripleo_baremetal_node_introspection.py +++ b/tripleo_ansible/ansible_plugins/modules/os_tripleo_baremetal_node_introspection.py @@ -262,8 +262,8 @@ def prepare_for_attempt(cloud, node, node_timeout, retry_timeout): node = cloud.baremetal.set_node_provision_state( node, 'abort', wait=True, timeout=node_timeout) except Exception as e: - LOG.warn("Abort introspection of node %s failed: %s", - node.id, str(e)) + LOG.warning("Abort introspection of node %s failed: %s", + node.id, str(e)) if node.power_state != 'power off': # Attempt to power off the node @@ -273,8 +273,8 @@ def prepare_for_attempt(cloud, node, node_timeout, retry_timeout): node, 'power off', wait=True, timeout=node_timeout ) except Exception as e: - LOG.warn("Power off of node %s failed: %s", - node.id, str(e)) + LOG.warning("Power off of node %s failed: %s", + node.id, str(e)) if node.reservation: # Wait until node is unlocked @@ -282,8 +282,8 @@ def prepare_for_attempt(cloud, node, node_timeout, retry_timeout): node = cloud.baremetal.wait_for_node_reservation( node, timeout=retry_timeout) except Exception as e: - LOG.warn("Waiting for node unlock %s failed: %s", - node.id, str(e)) + LOG.warning("Waiting for node unlock %s failed: %s", + node.id, str(e)) return node