Merge "Fix the grantee group loading for source groups"

This commit is contained in:
Jenkins 2011-10-12 00:21:42 +00:00 committed by Gerrit Code Review
commit d0f4a18e99

@ -2782,14 +2782,13 @@ def security_group_rule_get_by_security_group(context, security_group_id,
result = session.query(models.SecurityGroupIngressRule).\
filter_by(deleted=can_read_deleted(context)).\
filter_by(parent_group_id=security_group_id).\
options(joinedload_all('grantee_group')).\
options(joinedload_all('grantee_group.instances')).\
all()
else:
# TODO(vish): Join to group and check for project_id
result = session.query(models.SecurityGroupIngressRule).\
filter_by(deleted=False).\
filter_by(parent_group_id=security_group_id).\
options(joinedload_all('grantee_group')).\
options(joinedload_all('grantee_group.instances')).\
all()
return result