Browse Source

Update expected exception for missing ports

In some cases, we're ignoring exceptions caused by missing ports.
os-win is not really consistent with the exceptions it raises, for
which reason we have to loosen the caught excepton class a bit.

This would be caused mostly because of wmi object caching, which may
lead to some false positives when looking up ports.

Change-Id: I501fa15f0f0157d54170902e36ceff7fbd7b151b
Trace: http://paste.openstack.org/raw/734490/
Related-Bug: #1794975
Lucian Petrut 5 months ago
parent
commit
6dfee85972
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      networking_hyperv/neutron/_common_utils.py

+ 1
- 2
networking_hyperv/neutron/_common_utils.py View File

@@ -52,8 +52,7 @@ def ignore_missing_ports(f):
52 52
 
53 53
         try:
54 54
             return f(*args, **kwargs)
55
-        except (os_win_exc.HyperVPortNotFoundException,
56
-                os_win_exc.HyperVvNicNotFound):
55
+        except os_win_exc.NotFound:
57 56
             func_name = reflection.get_callable_name(f)
58 57
             LOG.warning("Could not find port '%(port_id)s' while executing "
59 58
                         "'%(func_name)s'. It may have been removed.",

Loading…
Cancel
Save