Skip to content

Commit

Permalink
Translate contrail to neutron resource type for quota error message
Browse files Browse the repository at this point in the history
Change-Id: Ic7cbd83948f65caa9ac07113460f48d953993619
Closes-Bug: #1668665
  • Loading branch information
Antoine Eiche committed Feb 28, 2017
1 parent 7c63d95 commit 9ffce8c
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -19,6 +19,7 @@
from neutron_plugin_contrail.plugins.opencontrail import contrail_plugin_base
from vnc_api import vnc_api

from neutron_plugin_contrail.plugins.opencontrail.quota.driver import QuotaDriver

class ContrailResourceHandler(object):

Expand Down Expand Up @@ -124,6 +125,10 @@ def _resource_create(self, obj):
resource=res_type)
except vnc_exc.OverQuota as e:
res_type = obj.get_type()
for n, c in QuotaDriver.quota_neutron_to_contrail_type.items():
if c.replace("_", "-") == res_type:
res_type = n

self._raise_contrail_exception('OverQuota',
overs=[res_type],
msg=str(e))
Expand Down

0 comments on commit 9ffce8c

Please sign in to comment.