Skip to content

Commit

Permalink
Catch PermissionDenied exception on security_group_update so that we …
Browse files Browse the repository at this point in the history
…can return proper error when sg rule quota is exceeded.

Change-Id: I1ebfe45a50521653ec92f115e12b692cc554dec4
Closes-Bug: 1365463
  • Loading branch information
Sachin Bansal committed Oct 15, 2014
1 parent 7645408 commit 1f95504
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py
Expand Up @@ -501,7 +501,11 @@ def _security_group_rule_create(self, sg_id, sg_rule):
rules.add_policy_rule(sg_rule)

sg_vnc.set_security_group_entries(rules)
self._vnc_lib.security_group_update(sg_vnc)
try:
self._vnc_lib.security_group_update(sg_vnc)
except PermissionDenied as e:
exc_info = {'type': 'BadRequest', 'message': str(e)}
bottle.abort(400, json.dumps(exc_info))
return
#end _security_group_rule_create

Expand Down

0 comments on commit 1f95504

Please sign in to comment.