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
This commit is contained in:
Michał Dulko 2019-02-20 17:08:08 +01:00
parent 2f756d9370
commit 8eaeb88d1e
1 changed files with 2 additions and 2 deletions

View File

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