]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Don't log exceptions in GW update on router create
authorKevin Benton <blak111@gmail.com>
Fri, 4 Sep 2015 11:22:35 +0000 (04:22 -0700)
committerKevin Benton <blak111@gmail.com>
Fri, 4 Sep 2015 12:20:23 +0000 (05:20 -0700)
The LOG.exception statement is not necessary because the exception
is re-raised so if it's a real error it will be logged like any
other failure.

Related-Bug: #1494886
Change-Id: I29aacd8c1187ddf8653009865ed9a62be948c5a7

neutron/db/l3_db.py

index 60ab661b9af08ca5fbc7410f0eb2fc2f886ea45d..2fd56d468f13a5ef1d9cd860839f653ca7fe96c3 100644 (file)
@@ -13,7 +13,6 @@
 #    under the License.
 
 import netaddr
-from oslo_db import exception as db_exc
 from oslo_log import log as logging
 from oslo_utils import uuidutils
 import sqlalchemy as sa
@@ -180,13 +179,9 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase):
             if gw_info:
                 self._update_router_gw_info(context, router_db['id'],
                                             gw_info, router=router_db)
-        except Exception as e:
+        except Exception:
             with excutils.save_and_reraise_exception():
-                # NOTE(kevinbenton): db errors will be retried by the decorator
-                # at the API layer so it's not a complete failure scenario.
-                if not isinstance(e, (db_exc.DBDeadlock, db_exc.RetryRequest)):
-                    LOG.exception(_LE("An exception occurred while creating "
-                                      "the router: %s"), router)
+                LOG.debug("Could not update gateway info, deleting router.")
                 self.delete_router(context, router_db.id)
 
         return self._make_router_dict(router_db)