From: Kevin Benton Date: Fri, 4 Sep 2015 11:22:35 +0000 (-0700) Subject: Don't log exceptions in GW update on router create X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=e959e474d65211991c12f9495b227da5e4d99ed7;p=openstack-build%2Fneutron-build.git Don't log exceptions in GW update on router create 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 --- diff --git a/neutron/db/l3_db.py b/neutron/db/l3_db.py index 60ab661b9..2fd56d468 100644 --- a/neutron/db/l3_db.py +++ b/neutron/db/l3_db.py @@ -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)