Skip to content

Commit

Permalink
contrail raises wrong quota exception
Browse files Browse the repository at this point in the history
This patch reraise OverQuota exception which
come from contrail.

In kilo and Liberty, OverQuota exception is defined
in neutron/common/exceptions.py.In Mitaka, it moved
to neutron_lib project neutron_lib/exceptions.py#L212

Change-Id: I92a8f36709f0f44eece2cff7afa5fcde2edc413e
Closes-Bug: #1590930
  • Loading branch information
sajuptpm committed Jun 20, 2016
1 parent 6dbcf4b commit 223b9ff
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -46,6 +46,11 @@
except ImportError:
from oslo_log import log as logging

try:
from neutron_lib import exceptions as libexc
except ImportError:
libexc = None

from simplejson import JSONDecodeError
from cfgm_common import utils as cfgmutils

Expand Down Expand Up @@ -322,6 +327,8 @@ def _raise_contrail_error(self, info, obj_name):
raise getattr(securitygroup, exc_name)(**info)
if hasattr(allowedaddresspairs, exc_name):
raise getattr(allowedaddresspairs, exc_name)(**info)
if libexc and hasattr(libexc, exc_name):
raise getattr(libexc, exc_name)(**info)
raise exc.NeutronException(**info)

def _create_resource(self, res_type, context, res_data):
Expand Down

0 comments on commit 223b9ff

Please sign in to comment.