Browse Source

use LOG.warning instead of LOG.warn

Minor clean-up to convert usage of deprecated LOG.warn method to
LOG.warning.

Change-Id: I597d44ac0d48571ffb29d55761fe2aff5a518302
Closes-Bug: #1508442
tags/2016.2.0
Mark McClain 2 years ago
parent
commit
1b01eb60a4
2 changed files with 23 additions and 23 deletions
  1. 20
    20
      networking_arista/ml2/arista_ml2.py
  2. 3
    3
      networking_arista/ml2/mechanism_arista.py

+ 20
- 20
networking_arista/ml2/arista_ml2.py View File

@@ -283,7 +283,7 @@ class AristaRPCWrapperBase(object):
283 283
             except Exception:
284 284
                 msg = (_("Failed to remove ACL %(sg)s on switch %(switch)%") %
285 285
                        {'sg': sg, 'switch': s['switch_info']})
286
-                LOG.warn(msg)
286
+                LOG.warning(msg)
287 287
         raise arista_exc.AristaSecurityGroupError(msg=msg)
288 288
 
289 289
     def create_acl(self, sg):
@@ -619,7 +619,7 @@ class AristaRPCWrapperJSON(AristaRPCWrapperBase):
619 619
             }
620 620
             func = func_lookup.get(method)
621 621
             if not func:
622
-                LOG.warn(_LI('Unrecognized HTTP method %s'), method)
622
+                LOG.warning(_LI('Unrecognized HTTP method %s'), method)
623 623
                 return None
624 624
 
625 625
             resp = func(url, timeout=self.conn_timeout, verify=False,
@@ -628,24 +628,24 @@ class AristaRPCWrapperJSON(AristaRPCWrapperBase):
628 628
             return resp.json()
629 629
         except requests.exceptions.ConnectionError:
630 630
             msg = (_('Error connecting to %(url)s') % {'url': url})
631
-            LOG.warn(msg)
631
+            LOG.warning(msg)
632 632
         except requests.exceptions.ConnectTimeout:
633 633
             msg = (_('Timed out connecting to API request to %(url)s') %
634 634
                    {'url': url})
635
-            LOG.warn(msg)
635
+            LOG.warning(msg)
636 636
         except requests.exceptions.Timeout:
637 637
             msg = (_('Timed out during API request to %(url)s') %
638 638
                    {'url': url})
639
-            LOG.warn(msg)
639
+            LOG.warning(msg)
640 640
         except requests.exceptions.InvalidURL:
641 641
             msg = (_('Ignore attempt to connect to invalid URL %(url)s') %
642 642
                    {'url': self._server_ip})
643
-            LOG.warn(msg)
643
+            LOG.warning(msg)
644 644
         except ValueError:
645
-            LOG.warn(_LW("Ignoring invalid JSON response: %s"), resp.text)
645
+            LOG.warning(_LW("Ignoring invalid JSON response: %s"), resp.text)
646 646
         except Exception as error:
647 647
             msg = unicode(error)
648
-            LOG.warn(msg)
648
+            LOG.warning(msg)
649 649
             # reraise the exception
650 650
             with excutils.save_and_reraise_exception() as ctxt:
651 651
                 ctxt.reraise = True
@@ -971,8 +971,8 @@ class AristaRPCWrapperJSON(AristaRPCWrapperBase):
971 971
                     # TODO(areimers) - DVR support
972 972
                     continue
973 973
                 else:
974
-                    LOG.warn(_LW("Unknown device owner: %s"),
975
-                             neutron_port['device_owner'])
974
+                    LOG.warning(_LW("Unknown device owner: %s"),
975
+                                neutron_port['device_owner'])
976 976
                     continue
977 977
 
978 978
                 network_id = neutron_port['network_id']
@@ -1153,29 +1153,29 @@ class AristaRPCWrapperEapi(AristaRPCWrapperBase):
1153 1153
         except requests.exceptions.ConnectionError:
1154 1154
             msg = (_('Error while trying to connect to %(ip)s') %
1155 1155
                    {'ip': self._server_ip})
1156
-            LOG.warn(msg)
1156
+            LOG.warning(msg)
1157 1157
             return None
1158 1158
         except requests.exceptions.ConnectTimeout:
1159 1159
             msg = (_('Timed out while trying to connect to %(ip)s') %
1160 1160
                    {'ip': self._server_ip})
1161
-            LOG.warn(msg)
1161
+            LOG.warning(msg)
1162 1162
             return None
1163 1163
         except requests.exceptions.Timeout:
1164 1164
             msg = (_('Timed out during an EAPI request to %(ip)s') %
1165 1165
                    {'ip': self._server_ip})
1166
-            LOG.warn(msg)
1166
+            LOG.warning(msg)
1167 1167
             return None
1168 1168
         except requests.exceptions.InvalidURL:
1169 1169
             msg = (_('Ignore attempt to connect to invalid URL %(ip)s') %
1170 1170
                    {'ip': self._server_ip})
1171
-            LOG.warn(msg)
1171
+            LOG.warning(msg)
1172 1172
             return None
1173 1173
         except ValueError:
1174 1174
             LOG.info("Ignoring invalid JSON response")
1175 1175
             return None
1176 1176
         except Exception as error:
1177 1177
             msg = unicode(error)
1178
-            LOG.warn(msg)
1178
+            LOG.warning(msg)
1179 1179
             raise
1180 1180
 
1181 1181
     def check_supported_features(self):
@@ -1185,8 +1185,8 @@ class AristaRPCWrapperEapi(AristaRPCWrapperBase):
1185 1185
             self.cli_commands[CMD_INSTANCE] = 'instance'
1186 1186
         except (arista_exc.AristaRpcError, Exception) as err:
1187 1187
             self.cli_commands[CMD_INSTANCE] = None
1188
-            LOG.warn(_LW("'instance' command is not available on EOS because "
1189
-                         "of %s"), err)
1188
+            LOG.warning(_LW("'instance' command is not available on EOS "
1189
+                            "because of %s"), err)
1190 1190
 
1191 1191
         # Get list of supported openstack features by CVX
1192 1192
         cmd = ['show openstack features']
@@ -1209,7 +1209,7 @@ class AristaRPCWrapperEapi(AristaRPCWrapperBase):
1209 1209
             self.cli_commands['resource-pool'] = cmd
1210 1210
         except arista_exc.AristaRpcError:
1211 1211
             self.cli_commands['resource-pool'] = []
1212
-            LOG.warn(
1212
+            LOG.warning(
1213 1213
                 _LW("'resource-pool' command '%s' is not available on EOS"),
1214 1214
                 cmd)
1215 1215
 
@@ -1637,8 +1637,8 @@ class AristaRPCWrapperEapi(AristaRPCWrapperBase):
1637 1637
                                     segment['id'])
1638 1638
                                     for level, segment in enumerate(segments))
1639 1639
                 else:
1640
-                    LOG.warn(_LW("Unknown device owner: %s"),
1641
-                             neutron_port['device_owner'])
1640
+                    LOG.warning(_LW("Unknown device owner: %s"),
1641
+                                neutron_port['device_owner'])
1642 1642
 
1643 1643
                 if self._heartbeat_required(sync, counter):
1644 1644
                     append_cmd(self.cli_commands[CMD_SYNC_HEARTBEAT])

+ 3
- 3
networking_arista/ml2/mechanism_arista.py View File

@@ -716,7 +716,7 @@ class AristaDriver(driver_api.MechanismDriver):
716 716
                     except ml2_exc.MechanismDriverError:
717 717
                         # If deleting a port fails, then not much can be done
718 718
                         # about it. Log a warning and move on.
719
-                        LOG.warn(UNABLE_TO_DELETE_PORT_MSG)
719
+                        LOG.warning(UNABLE_TO_DELETE_PORT_MSG)
720 720
                 if(port_provisioned and net_provisioned and hostname and
721 721
                    is_vm_boot and not port_down):
722 722
                     LOG.info(_LI("Port plugged into network"))
@@ -780,7 +780,7 @@ class AristaDriver(driver_api.MechanismDriver):
780 780
             except ml2_exc.MechanismDriverError:
781 781
                 # Can't do much if deleting a port failed.
782 782
                 # Log a warning and continue.
783
-                LOG.warn(UNABLE_TO_DELETE_PORT_MSG)
783
+                LOG.warning(UNABLE_TO_DELETE_PORT_MSG)
784 784
 
785 785
     def _delete_port(self, port, host, tenant_id):
786 786
         """Deletes the port from EOS.
@@ -803,7 +803,7 @@ class AristaDriver(driver_api.MechanismDriver):
803 803
         sg = port['security_groups']
804 804
 
805 805
         if not device_id or not host:
806
-            LOG.warn(UNABLE_TO_DELETE_DEVICE_MSG)
806
+            LOG.warning(UNABLE_TO_DELETE_DEVICE_MSG)
807 807
             return
808 808
 
809 809
         try:

Loading…
Cancel
Save