make get_all_security_groups filter AND match group ids, not OR them (#822)
This commit is contained in:
parent
1045dca7b2
commit
012dd497f2
2 changed files with 19 additions and 4 deletions
|
|
@ -1309,10 +1309,12 @@ class SecurityGroupBackend(object):
|
|||
|
||||
if group_ids or groupnames or filters:
|
||||
for group in all_groups:
|
||||
if ((group_ids and group.id in group_ids) or
|
||||
(groupnames and group.name in groupnames) or
|
||||
(filters and group.matches_filters(filters))):
|
||||
groups.append(group)
|
||||
if ((group_ids and not group.id in group_ids) or
|
||||
(groupnames and not group.name in groupnames)):
|
||||
continue
|
||||
if filters and not group.matches_filters(filters):
|
||||
continue
|
||||
groups.append(group)
|
||||
else:
|
||||
groups = all_groups
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue