Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Cloud:OpenStack:Kilo
openstack-nova-doc
0001-Fix-instance-filtering.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Fix-instance-filtering.patch of Package openstack-nova-doc
From 563328d3af3a915561f8faf9391582005c167fa0 Mon Sep 17 00:00:00 2001 From: Michal Jura <mjura@suse.com> Date: Wed, 28 Oct 2015 14:58:59 +0100 Subject: [PATCH] This patch allows for tenant filtering. For example: nova list --tenant <tenant_id> Previously, tenant_id was accepted but did not give desirable output. If you don't pass tenant_id, the current context tenant will be used. Closes-Bug: #1398329 (cherry picked from commit b4e50819833d1f1e7983add35a925db4c1e7cd86) Change-Id: I9a23fb754384fd35b872a5174779d18211581078 --- nova/api/openstack/compute/plugins/v3/servers.py | 9 ++++++--- nova/api/openstack/compute/servers.py | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/nova/api/openstack/compute/plugins/v3/servers.py b/nova/api/openstack/compute/plugins/v3/servers.py index 6d526cc..a0a0010 100644 --- a/nova/api/openstack/compute/plugins/v3/servers.py +++ b/nova/api/openstack/compute/plugins/v3/servers.py @@ -355,10 +355,13 @@ class ServersController(wsgi.Controller): authorize(context, action="index:get_all_tenants") del search_opts['all_tenants'] else: - if context.project_id: - search_opts['project_id'] = context.project_id + if 'tenant_id' in search_opts: + search_opts['project_id'] = search_opts['tenant_id'] else: - search_opts['user_id'] = context.user_id + if context.project_id: + search_opts['project_id'] = context.project_id + else: + search_opts['user_id'] = context.user_id limit, marker = common.get_limit_and_marker(req) sort_keys, sort_dirs = common.get_sort_params(req.params) diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index d3d52ae..36b037d 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -203,10 +203,13 @@ class Controller(wsgi.Controller): 'user_id': context.user_id}) del search_opts['all_tenants'] else: - if context.project_id: - search_opts['project_id'] = context.project_id + if 'tenant_id' in search_opts: + search_opts['project_id'] = search_opts['tenant_id'] else: - search_opts['user_id'] = context.user_id + if context.project_id: + search_opts['project_id'] = context.project_id + else: + search_opts['user_id'] = context.user_id limit, marker = common.get_limit_and_marker(req) # Sorting by multiple keys and directions is conditionally enabled -- 2.1.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor