def list_security_groups(self, req, tenant_id): ''' list all security groups ''' result, headers = self._nova_request(req) try: groups = result['security_groups'] auth_token = req.context.auth_tok for group in groups: group.pop("rules") tenant_id = group.get("tenant_id") tenant = ops_api.get_tenant(tenant_id, auth_token) tenant_name = tenant['name'] group.update(tenant_name=tenant_name) groups = list_filter.filter_security_groups(req, groups) groups = list_sort.sort_security_groups(req, groups) return dict(security_groups=groups) except KeyError: LOG.exception(_("repack server data error.")) raise exc.HTTPFailedDependency(_("Nova method deprecated."))