Browse Source

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
tags/2.0.0.0b1
Wanlong Gao 3 years ago
parent
commit
2fde87a0e9
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      docker/base/set_configs.py
  2. 1
    1
      tests/clients.py

+ 1
- 1
docker/base/set_configs.py View File

@@ -57,7 +57,7 @@ def validate_source(data):
57 57
 
58 58
     if not exists:
59 59
         if data.get('optional'):
60
-            LOG.warn("%s does not exist, but is not required", source)
60
+            LOG.warning("%s does not exist, but is not required", source)
61 61
             return False
62 62
         else:
63 63
             LOG.error("The source to copy does not exist: %s", source)

+ 1
- 1
tests/clients.py View File

@@ -37,7 +37,7 @@ class OpenStackClients(object):
37 37
             return connected_client
38 38
 
39 39
         except StopIteration:
40
-            LOG.warn("Requested client %s not found", name)
40
+            LOG.warning("Requested client %s not found", name)
41 41
             raise
42 42
 
43 43
     def create(self):

Loading…
Cancel
Save