summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/servers.py5
-rw-r--r--nova/api/openstack/views/servers.py1
2 files changed, 6 insertions, 0 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 41e63ec3c..57ed5f45e 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -107,6 +107,11 @@ class Controller(object):
LOG.error(reason)
raise exception.InvalidInput(reason=reason)
+ # translate tenant_id filter to internal project_id
+ if 'tenant_id' in search_opts:
+ search_opts['project_id'] = search_opts['tenant_id']
+ del search_opts['tenant_id']
+
# By default, compute's get_all() will return deleted instances.
# If an admin hasn't specified a 'deleted' search option, we need
# to filter out deleted instances by setting the filter ourselves.
diff --git a/nova/api/openstack/views/servers.py b/nova/api/openstack/views/servers.py
index c5f1e6021..37f48b3b2 100644
--- a/nova/api/openstack/views/servers.py
+++ b/nova/api/openstack/views/servers.py
@@ -65,6 +65,7 @@ class ViewBuilder(object):
'id': inst['id'],
'name': inst['display_name'],
'user_id': inst['user_id'],
+ 'tenant_id': inst['project_id'],
'description': inst['display_description'],
'status': common.status_from_power_state(inst.get('state'))}