From 2fde87a0e91689aaf3c918209f1ee8a1d832d6f3 Mon Sep 17 00:00:00 2001 From: Wanlong Gao Date: Tue, 29 Dec 2015 14:37:10 +0800 Subject: [PATCH] Python 3 deprecated the logger.warn method in favor of warning Python 3 deprecated the logger.warn method, see: https://docs.python.org/3/library/logging.html#logging.warning, so we prefer to use warning to avoid DeprecationWarning. Change-Id: Ic4e07276def17ef39764601c8a7e0991f9a4efbc Closes-Bug: 1508442 --- docker/base/set_configs.py | 2 +- tests/clients.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/base/set_configs.py b/docker/base/set_configs.py index cbcf54e163..5db8bdedcf 100644 --- a/docker/base/set_configs.py +++ b/docker/base/set_configs.py @@ -57,7 +57,7 @@ def validate_source(data): if not exists: if data.get('optional'): - LOG.warn("%s does not exist, but is not required", source) + LOG.warning("%s does not exist, but is not required", source) return False else: LOG.error("The source to copy does not exist: %s", source) diff --git a/tests/clients.py b/tests/clients.py index 6b2aef5281..a845579b1b 100644 --- a/tests/clients.py +++ b/tests/clients.py @@ -37,7 +37,7 @@ class OpenStackClients(object): return connected_client except StopIteration: - LOG.warn("Requested client %s not found", name) + LOG.warning("Requested client %s not found", name) raise def create(self):