Browse Source

Switch except statements order

neutronclient.common.exceptions.NotFound is subclass of
neutronclient.common.exceptions.NeutronClientexception, so statements
catching the latter should be last of except clauses. This commit
switches order of except statements in LBaaSv2Driver to fix that.

Change-Id: Id60457fc86e2bcf836cf854b12b2872fd68a35f5
Michał Dulko 1 month ago
parent
commit
8eaeb88d1e
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      kuryr_kubernetes/controller/drivers/lbaasv2.py

+ 2
- 2
kuryr_kubernetes/controller/drivers/lbaasv2.py View File

@@ -101,11 +101,11 @@ class LBaaSv2Driver(base.LBaaSDriver):
101 101
             self._wait_for_deletion(loadbalancer, _ACTIVATION_TIMEOUT)
102 102
             try:
103 103
                 neutron.delete_security_group(sg_id)
104
+            except n_exc.NotFound:
105
+                LOG.debug('Security group %s already deleted', sg_id)
104 106
             except n_exc.NeutronClientException:
105 107
                 LOG.exception('Error when deleting loadbalancer security '
106 108
                               'group. Leaving it orphaned.')
107
-            except n_exc.NotFound:
108
-                LOG.debug('Security group %s already deleted', sg_id)
109 109
 
110 110
     def _create_lb_security_group_rule(self, loadbalancer, listener):
111 111
         neutron = clients.get_neutron_client()

Loading…
Cancel
Save