Browse Source

Replace deprecated LOG.warn with LOG.warning

Closes-Bug: #1508442
Change-Id: Ifcc2004f3274808d868c9947ed2b0b484f815daa
tags/2.3.0
Zhenguo Niu 3 years ago
parent
commit
bcd8d5dfa0

+ 2
- 2
ironic_inspector/firewall.py View File

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

+ 9
- 6
ironic_inspector/node_cache.py View File

@@ -165,8 +165,9 @@ class NodeInfo(object):
165 165
             if mac not in self.ports():
166 166
                 self._create_port(mac)
167 167
             else:
168
-                LOG.warn(_LW('Port %(mac)s already exists for node %(uuid)s, '
169
-                             'skipping'), {'mac': mac, 'uuid': self.uuid})
168
+                LOG.warning(
169
+                    _LW('Port %(mac)s already exists for node %(uuid)s, '
170
+                        'skipping'), {'mac': mac, 'uuid': self.uuid})
170 171
 
171 172
     def ports(self):
172 173
         """Get Ironic port objects associated with the cached node record.
@@ -184,8 +185,9 @@ class NodeInfo(object):
184 185
         try:
185 186
             port = self.ironic.port.create(node_uuid=self.uuid, address=mac)
186 187
         except exceptions.Conflict:
187
-            LOG.warn(_LW('Port %(mac)s already exists for node %(uuid)s, '
188
-                         'skipping'), {'mac': mac, 'uuid': self.uuid})
188
+            LOG.warning(
189
+                _LW('Port %(mac)s already exists for node %(uuid)s, '
190
+                    'skipping'), {'mac': mac, 'uuid': self.uuid})
189 191
             # NOTE(dtantsur): we didn't get port object back, so we have to
190 192
             # reload ports on next access
191 193
             self._ports = None
@@ -328,8 +330,9 @@ def delete_nodes_not_in_list(uuids):
328 330
     """
329 331
     inspector_uuids = _list_node_uuids()
330 332
     for uuid in inspector_uuids - uuids:
331
-        LOG.warn(_LW('Node %s was deleted from Ironic, dropping from Ironic '
332
-                     'Inspector database'), uuid)
333
+        LOG.warning(
334
+            _LW('Node %s was deleted from Ironic, dropping from Ironic '
335
+                'Inspector database'), uuid)
333 336
         _delete_node(uuid)
334 337
 
335 338
 

+ 4
- 3
ironic_inspector/plugins/standard.py View File

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

+ 2
- 2
ironic_inspector/process.py View File

@@ -131,11 +131,11 @@ def _run_post_hooks(node_info, introspection_data):
131 131
                                    node_patches=node_patches,
132 132
                                    ports_patches=ports_patches)
133 133
         if node_patches:
134
-            LOG.warn(_LW('Using node_patches is deprecated'))
134
+            LOG.warning(_LW('Using node_patches is deprecated'))
135 135
             node_info.patch(node_patches)
136 136
 
137 137
         if ports_patches:
138
-            LOG.warn(_LW('Using ports_patches is deprecated'))
138
+            LOG.warning(_LW('Using ports_patches is deprecated'))
139 139
             for mac, patches in ports_patches.items():
140 140
                 node_info.patch_port(mac, patches)
141 141
 

+ 3
- 2
ironic_inspector/utils.py View File

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

Loading…
Cancel
Save