diff options
| author | Soren Hansen <soren.hansen@rackspace.com> | 2010-09-29 09:54:22 +0200 |
|---|---|---|
| committer | Soren Hansen <soren.hansen@rackspace.com> | 2010-09-29 09:54:22 +0200 |
| commit | e609dd8620796f4eadefcff6130dfeae06b97ef4 (patch) | |
| tree | 2dc4c26b15f07e5fdf67dc92b291e6ac9621ae8e /nova/db | |
| parent | bfb01ef2e2960803feffb2a3998810b0966e1e79 (diff) | |
| parent | 84fbad82d65b837d43f138e7a5acd24f182499e2 (diff) | |
| download | nova-e609dd8620796f4eadefcff6130dfeae06b97ef4.tar.gz nova-e609dd8620796f4eadefcff6130dfeae06b97ef4.tar.xz nova-e609dd8620796f4eadefcff6130dfeae06b97ef4.zip | |
Merge patch from Vish to move creation of default security groups into the API layer. This is a temporary fix. We need to sort out for Austin+1 how to deal with things like this.
Diffstat (limited to 'nova/db')
| -rw-r--r-- | nova/db/api.py | 5 | ||||
| -rw-r--r-- | nova/db/sqlalchemy/api.py | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/nova/db/api.py b/nova/db/api.py index 602c3cf09..5e033b59d 100644 --- a/nova/db/api.py +++ b/nova/db/api.py @@ -604,6 +604,11 @@ def security_group_destroy(context, security_group_id): return IMPL.security_group_destroy(context, security_group_id) +def security_group_destroy_all(context): + """Deletes a security group""" + return IMPL.security_group_destroy_all(context) + + #################### diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index d2847506e..07ea5d145 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -947,6 +947,12 @@ def security_group_destroy(_context, security_group_id): 'where group_id=:id', {'id': security_group_id}) +def security_group_destroy_all(_context): + session = get_session() + with session.begin(): + # TODO(vish): do we have to use sql here? + session.execute('update security_group set deleted=1') + session.execute('update security_group_rules set deleted=1') ################### |
