diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-02-22 18:05:16 -0800 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-02-22 18:05:16 -0800 |
| commit | 4bc6e8c467d0ff98b552b2f50622baf8b6175d3d (patch) | |
| tree | 79a7538620289dce4ac99996d69411c7aa320b69 /nova/api | |
| parent | ef37833e6f45f99b1d16143d29685974a191c387 (diff) | |
| parent | 828e3ea3f29f57767a4e25ad40b275c886cb7968 (diff) | |
merged fix-describe-groups
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/cloud.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 882cdcfc9..fc9c13d91 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -318,14 +318,19 @@ class CloudController(object): def describe_security_groups(self, context, group_name=None, **kwargs): self.compute_api.ensure_default_security_group(context) - if context.is_admin: + if group_name: + groups = [] + for name in group_name: + group = db.security_group_get_by_name(context, + context.project_id, + name) + groups.append(group) + elif context.is_admin: groups = db.security_group_get_all(context) else: groups = db.security_group_get_by_project(context, context.project_id) groups = [self._format_security_group(context, g) for g in groups] - if not group_name is None: - groups = [g for g in groups if g.name in group_name] return {'securityGroupInfo': list(sorted(groups, |
