Skip to content

Commit

Permalink
Deleting security group does not mark rules as deleted
Browse files Browse the repository at this point in the history
Adds query to also delete rules for parent_group_id

Fixes bug 1056380

Change-Id: I3d041b49703bf298a80d2ebe19c1298eecf2d98d
  • Loading branch information
aaronorosen authored and Chuck Short committed Oct 5, 2012
1 parent 9e20735 commit 724adcf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nova/db/sqlalchemy/api.py
Expand Up @@ -3571,6 +3571,12 @@ def security_group_destroy(context, security_group_id):
'deleted_at': timeutils.utcnow(),
'updated_at': literal_column('updated_at')})

session.query(models.SecurityGroupIngressRule).\
filter_by(parent_group_id=security_group_id).\
update({'deleted': True,
'deleted_at': timeutils.utcnow(),
'updated_at': literal_column('updated_at')})


@require_context
def security_group_count_by_project(context, project_id, session=None):
Expand Down

0 comments on commit 724adcf

Please sign in to comment.