diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-08-31 18:37:04 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-08-31 18:37:04 +0000 |
| commit | 0aca4908766bc5a622839e8563cfa33fd17ff427 (patch) | |
| tree | 74bcbcb5d512a50c435c238b5090acf843fed2a7 /nova/compute | |
| parent | 882b483f8ec7efc5c4f4981dfc300b643e252548 (diff) | |
| parent | 2525afadd3475143040e6a4fe4021dc911a3f159 (diff) | |
Merge "Avoid leaking security group quota reservations"
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 6ce5b5526..58044ed7f 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -2110,13 +2110,14 @@ class SecurityGroupAPI(base.Base): LOG.audit(_("Create Security Group %s"), name, context=context) - self.ensure_default(context) + try: + self.ensure_default(context) - if self.db.security_group_exists(context, context.project_id, name): - msg = _('Security group %s already exists') % name - self.raise_group_already_exists(msg) + if self.db.security_group_exists(context, + context.project_id, name): + msg = _('Security group %s already exists') % name + self.raise_group_already_exists(msg) - try: group = {'user_id': context.user_id, 'project_id': context.project_id, 'name': name, |
