]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove superfluous except/re-raise
authorAngus Lees <gus@inodes.org>
Mon, 20 Oct 2014 00:19:02 +0000 (11:19 +1100)
committerAngus Lees <gus@inodes.org>
Mon, 20 Oct 2014 00:23:20 +0000 (11:23 +1100)
This exception code catches all exceptions, and then always raises them
again.

More interestingly, it uses excutils.save_and_reraise_exception
incorrectly (outside a `with` statement), which triggers the pylint test
designed to catch exactly this.

Change-Id: Iab9d69944cbae5257682ac65ff2b8fba3ef7017e

neutron/services/l3_router/brocade/l3_router_plugin.py

index 56428c8c2f803c73735c3862362b8d9180ed851a..1826b83a6aed7522f7d34fbd2a24612a6941eab1 100644 (file)
@@ -101,15 +101,13 @@ class BrocadeSVIPlugin(router.L3RouterPlugin):
         """ delete a vrf on NOS device."""
         router = super(BrocadeSVIPlugin, self).get_router(context, router_id)
         super(BrocadeSVIPlugin, self).delete_router(context, router_id)
-        try:
-            switch = self._switch
-            self._driver.delete_router(switch['address'],
-                                       switch['username'],
-                                       switch['password'],
-                                       switch['rbridge_id'],
-                                       str(router['id']))
-        except Exception:
-            excutils.save_and_reraise_exception()
+
+        switch = self._switch
+        self._driver.delete_router(switch['address'],
+                                   switch['username'],
+                                   switch['password'],
+                                   switch['rbridge_id'],
+                                   str(router['id']))
 
     def add_router_interface(self, context, router_id, interface_info):
         """creates svi on NOS device and assigns ip addres to SVI."""