From 5ef94944514c3f81e31cc60d3d63b903859dca45 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Thu, 18 Aug 2011 22:15:13 -0700 Subject: add user_id and description. without user_id, there is no way for a tenant to tell which user created the server. description should be added for ec2 parity. --- nova/api/openstack/create_instance_helper.py | 3 ++- nova/api/openstack/views/servers.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py index 978741682..96f817d38 100644 --- a/nova/api/openstack/create_instance_helper.py +++ b/nova/api/openstack/create_instance_helper.py @@ -154,7 +154,8 @@ class CreateInstanceHelper(object): kernel_id=kernel_id, ramdisk_id=ramdisk_id, display_name=name, - display_description=name, + display_description=\ + server_dict.get('description', ''), key_name=key_name, key_data=key_data, metadata=server_dict.get('metadata', {}), diff --git a/nova/api/openstack/views/servers.py b/nova/api/openstack/views/servers.py index edc328129..c5f1e6021 100644 --- a/nova/api/openstack/views/servers.py +++ b/nova/api/openstack/views/servers.py @@ -64,6 +64,8 @@ class ViewBuilder(object): inst_dict = { 'id': inst['id'], 'name': inst['display_name'], + 'user_id': inst['user_id'], + 'description': inst['display_description'], 'status': common.status_from_power_state(inst.get('state'))} ctxt = nova.context.get_admin_context() -- cgit From 34ef09beb3bf00fd9eb16b8517c520af24641e8c Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Fri, 19 Aug 2011 10:10:51 -0700 Subject: add tenant_id to api. without tenant_id, admins can't tell which servers belong to which tenants when retrieving lists --- nova/api/openstack/servers.py | 5 +++++ nova/api/openstack/views/servers.py | 1 + 2 files changed, 6 insertions(+) (limited to 'nova/api') 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'))} -- cgit From 49ef06ba21115a64c2efbb6fa81e0e6ee3f9095d Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Mon, 22 Aug 2011 16:21:29 -0700 Subject: xml deserialization, and test fixes --- nova/api/openstack/servers.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 57ed5f45e..7faeb7278 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -183,6 +183,10 @@ class Controller(object): self.helper._validate_server_name(name) update_dict['display_name'] = name.strip() + if 'description' in body['server']: + description = body['server']['description'] + update_dict['display_description'] = description.strip() + try: self.compute_api.update(ctxt, id, **update_dict) except exception.NotFound: @@ -836,9 +840,12 @@ class ServerXMLSerializer(wsgi.XMLDictSerializer): def _add_server_attributes(self, node, server): node.setAttribute('id', str(server['id'])) + node.setAttribute('userId', str(server['user_id'])) + node.setAttribute('tenantId', str(server['tenant_id'])) node.setAttribute('uuid', str(server['uuid'])) node.setAttribute('hostId', str(server['hostId'])) node.setAttribute('name', server['name']) + node.setAttribute('description', server['description']) node.setAttribute('created', str(server['created'])) node.setAttribute('updated', str(server['updated'])) node.setAttribute('status', server['status']) @@ -945,7 +952,7 @@ def create_resource(version='1.0'): "attributes": { "server": ["id", "imageId", "name", "flavorId", "hostId", "status", "progress", "adminPass", "flavorRef", - "imageRef"], + "imageRef", "userId", "tenantId", "description"], "link": ["rel", "type", "href"], }, "dict_collections": { -- cgit From af39051bd033e9e4017fec0fe1647aef582bc38e Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Mon, 22 Aug 2011 17:02:54 -0700 Subject: fix pep8 issue --- nova/api/openstack/create_instance_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py index 96f817d38..b0cdd87ea 100644 --- a/nova/api/openstack/create_instance_helper.py +++ b/nova/api/openstack/create_instance_helper.py @@ -154,8 +154,8 @@ class CreateInstanceHelper(object): kernel_id=kernel_id, ramdisk_id=ramdisk_id, display_name=name, - display_description=\ - server_dict.get('description', ''), + display_description=server_dict.\ + get('description', ''), key_name=key_name, key_data=key_data, metadata=server_dict.get('metadata', {}), -- cgit From 0571c86d18c242f46e44e380b257cfc40598d31b Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Wed, 24 Aug 2011 12:17:58 -0700 Subject: use dict.get for user_id, project_id, and display_description in servers view as suggested by ed leaf, so that not all tests require these fields --- nova/api/openstack/views/servers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/views/servers.py b/nova/api/openstack/views/servers.py index fd7c040d4..6fd09aae6 100644 --- a/nova/api/openstack/views/servers.py +++ b/nova/api/openstack/views/servers.py @@ -65,9 +65,9 @@ class ViewBuilder(object): inst_dict = { 'id': inst['id'], 'name': inst['display_name'], - 'user_id': inst['user_id'], - 'tenant_id': inst['project_id'], - 'description': inst['display_description'], + 'user_id': inst.get('user_id', ''), + 'tenant_id': inst.get('project_id', ''), + 'description': inst.get('display_description', ''), 'status': common.status_from_power_state(inst.get('state'))} ctxt = nova.context.get_admin_context() -- cgit From b515d427e05010ba5a984dd549cb6418629de50d Mon Sep 17 00:00:00 2001 From: Thuleau Édouard Date: Tue, 30 Aug 2011 18:18:23 +0200 Subject: With OS API, if the property 'ramdisk_id' isn't set on the AMI image, Nova can not instantiate it. With EC2 API, the AMI image can be instantiate. --- nova/api/openstack/create_instance_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py index 483ff4985..269e46dba 100644 --- a/nova/api/openstack/create_instance_helper.py +++ b/nova/api/openstack/create_instance_helper.py @@ -283,7 +283,7 @@ class CreateInstanceHelper(object): try: ramdisk_id = image_meta['properties']['ramdisk_id'] except KeyError: - raise exception.RamdiskNotFoundForImage(image_id=image_id) + ramdisk_id = None return kernel_id, ramdisk_id -- cgit From ced3ea3e8d7cf02f988d968d6078182815226719 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Wed, 31 Aug 2011 12:23:43 -0700 Subject: fix for chris behrens' comment - move tenant_id => project_id mapping to compute.api.get_all --- nova/api/openstack/servers.py | 5 ----- 1 file changed, 5 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 3e76fa1a0..5bbb4e52e 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -107,11 +107,6 @@ 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. -- cgit From a36e0a1cbc5645ab47041c2627dba80b39b23cc2 Mon Sep 17 00:00:00 2001 From: Brian Lamar Date: Thu, 1 Sep 2011 15:42:01 -0400 Subject: Fixes for minor network manager issues centered around deleting/accessing instances which don't have network information set. --- nova/api/openstack/views/addresses.py | 1 - 1 file changed, 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/views/addresses.py b/nova/api/openstack/views/addresses.py index 8f07a2289..8d38bc9c3 100644 --- a/nova/api/openstack/views/addresses.py +++ b/nova/api/openstack/views/addresses.py @@ -88,7 +88,6 @@ class ViewBuilderV11(ViewBuilder): try: return interface['network']['label'] except (TypeError, KeyError) as exc: - LOG.exception(exc) raise TypeError def _extract_ipv4_addresses(self, interface): -- cgit From cc3bd1da5edc368871d2c8de0e498ab2649ae0dd Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Fri, 2 Sep 2011 12:52:02 -0700 Subject: revert description changes, use metadata['description'] if it is set to populate field in db --- nova/api/openstack/create_instance_helper.py | 9 ++++++--- nova/api/openstack/schemas/v1.1/server.rng | 1 - nova/api/openstack/servers.py | 6 +----- nova/api/openstack/views/servers.py | 1 - 4 files changed, 7 insertions(+), 10 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py index ff3be4a01..289f87921 100644 --- a/nova/api/openstack/create_instance_helper.py +++ b/nova/api/openstack/create_instance_helper.py @@ -161,6 +161,10 @@ class CreateInstanceHelper(object): 'config_drive': config_drive, 'password': password} + # NOTE(vish): This is solely for compatibility with anything + # that is using the display description field. + metadata = server_dict.get('metadata') or {} + display_description = metadata.get('description') or '' return (extra_values, create_method(context, inst_type, @@ -168,10 +172,9 @@ class CreateInstanceHelper(object): kernel_id=kernel_id, ramdisk_id=ramdisk_id, display_name=name, - display_description=server_dict.\ - get('description', ''), + display_description=display_description, key_name=key_name, - metadata=server_dict.get('metadata', {}), + metadata=metadata, access_ip_v4=server_dict.get('accessIPv4'), access_ip_v6=server_dict.get('accessIPv6'), injected_files=injected_files, diff --git a/nova/api/openstack/schemas/v1.1/server.rng b/nova/api/openstack/schemas/v1.1/server.rng index 203728f48..ef835e408 100644 --- a/nova/api/openstack/schemas/v1.1/server.rng +++ b/nova/api/openstack/schemas/v1.1/server.rng @@ -3,7 +3,6 @@ - diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 7f5463e70..46a111cf5 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -185,9 +185,6 @@ class Controller(object): self.helper._validate_server_name(name) update_dict['display_name'] = name.strip() - if 'description' in body['server']: - description = body['server']['description'] - update_dict['display_description'] = description.strip() if 'accessIPv4' in body['server']: access_ipv4 = body['server']['accessIPv4'] update_dict['access_ip_v4'] = access_ipv4.strip() @@ -881,7 +878,6 @@ class ServerXMLSerializer(wsgi.XMLDictSerializer): node.setAttribute('uuid', str(server['uuid'])) node.setAttribute('hostId', str(server['hostId'])) node.setAttribute('name', server['name']) - node.setAttribute('description', server['description']) node.setAttribute('created', str(server['created'])) node.setAttribute('updated', str(server['updated'])) node.setAttribute('status', server['status']) @@ -997,7 +993,7 @@ def create_resource(version='1.0'): "attributes": { "server": ["id", "imageId", "name", "flavorId", "hostId", "status", "progress", "adminPass", "flavorRef", - "imageRef", "userId", "tenantId", "description"], + "imageRef", "userId", "tenantId"], "link": ["rel", "type", "href"], }, "dict_collections": { diff --git a/nova/api/openstack/views/servers.py b/nova/api/openstack/views/servers.py index 98ccd817a..ac09b5864 100644 --- a/nova/api/openstack/views/servers.py +++ b/nova/api/openstack/views/servers.py @@ -68,7 +68,6 @@ class ViewBuilder(object): 'name': inst['display_name'], 'user_id': inst.get('user_id', ''), 'tenant_id': inst.get('project_id', ''), - 'description': inst.get('display_description', ''), 'status': common.status_from_state(vm_state, task_state)} # Return the metadata as a dictionary -- cgit From 6eb28b5748a829d058fd35888f03f2ee1f26f5b5 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Fri, 2 Sep 2011 13:31:19 -0700 Subject: default description to name --- nova/api/openstack/create_instance_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py index 289f87921..9b2928bc8 100644 --- a/nova/api/openstack/create_instance_helper.py +++ b/nova/api/openstack/create_instance_helper.py @@ -164,7 +164,7 @@ class CreateInstanceHelper(object): # NOTE(vish): This is solely for compatibility with anything # that is using the display description field. metadata = server_dict.get('metadata') or {} - display_description = metadata.get('description') or '' + display_description = metadata.get('description') or name return (extra_values, create_method(context, inst_type, -- cgit From 1f3856ffb92ab690b1d630deb6fa025ae74348f7 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Tue, 6 Sep 2011 12:48:41 -0700 Subject: revert changes to display description --- nova/api/openstack/create_instance_helper.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py index 9b2928bc8..29e071609 100644 --- a/nova/api/openstack/create_instance_helper.py +++ b/nova/api/openstack/create_instance_helper.py @@ -161,10 +161,6 @@ class CreateInstanceHelper(object): 'config_drive': config_drive, 'password': password} - # NOTE(vish): This is solely for compatibility with anything - # that is using the display description field. - metadata = server_dict.get('metadata') or {} - display_description = metadata.get('description') or name return (extra_values, create_method(context, inst_type, @@ -172,9 +168,9 @@ class CreateInstanceHelper(object): kernel_id=kernel_id, ramdisk_id=ramdisk_id, display_name=name, - display_description=display_description, + display_description=name, key_name=key_name, - metadata=metadata, + metadata=server_dict.get('metadata', {}), access_ip_v4=server_dict.get('accessIPv4'), access_ip_v6=server_dict.get('accessIPv6'), injected_files=injected_files, -- cgit From b6d454762d7fdf9b202d8a580dd9bfdf069a5e80 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Wed, 7 Sep 2011 16:38:41 -0700 Subject: fix for lp844364: improve check for fixed_ip association --- nova/api/openstack/contrib/floating_ips.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/contrib/floating_ips.py b/nova/api/openstack/contrib/floating_ips.py index d1add8f83..9ceb5858f 100644 --- a/nova/api/openstack/contrib/floating_ips.py +++ b/nova/api/openstack/contrib/floating_ips.py @@ -107,7 +107,7 @@ class FloatingIPController(object): context = req.environ['nova.context'] floating_ip = self.network_api.get_floating_ip(context, id) - if 'fixed_ip' in floating_ip: + if floating_ip['fixed_ip']: self.network_api.disassociate_floating_ip(context, floating_ip['address']) @@ -161,7 +161,7 @@ class Floating_ips(extensions.ExtensionDescriptor): raise webob.exc.HTTPBadRequest(explanation=msg) floating_ip = self.network_api.get_floating_ip_by_ip(context, address) - if 'fixed_ip' in floating_ip: + if floating_ip['fixed_ip']: self.network_api.disassociate_floating_ip(context, address) return webob.Response(status_int=202) -- cgit From 4bf6508a026c62a7aa2423b1910c871ddc3f0916 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 8 Sep 2011 15:26:44 -0400 Subject: converting fix to just address ec2; updating test --- nova/api/ec2/cloud.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 049ca6f93..4f7030a5a 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -1200,8 +1200,10 @@ class CloudController(object): instances.append(instance) else: try: + # always filter out deleted instances + search_opts['deleted'] = False instances = self.compute_api.get_all(context, - search_opts=search_opts) + search_opts=search_opts) except exception.NotFound: instances = [] for instance in instances: -- cgit From fe355a10ad0a215eb5295e46e6c106221972e7ed Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Thu, 8 Sep 2011 13:18:08 -0700 Subject: make check for fixed_ip association more defensive --- nova/api/openstack/contrib/floating_ips.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/contrib/floating_ips.py b/nova/api/openstack/contrib/floating_ips.py index 9ceb5858f..d078b26c6 100644 --- a/nova/api/openstack/contrib/floating_ips.py +++ b/nova/api/openstack/contrib/floating_ips.py @@ -107,7 +107,7 @@ class FloatingIPController(object): context = req.environ['nova.context'] floating_ip = self.network_api.get_floating_ip(context, id) - if floating_ip['fixed_ip']: + if floating_ip.get('fixed_ip'): self.network_api.disassociate_floating_ip(context, floating_ip['address']) @@ -161,7 +161,7 @@ class Floating_ips(extensions.ExtensionDescriptor): raise webob.exc.HTTPBadRequest(explanation=msg) floating_ip = self.network_api.get_floating_ip_by_ip(context, address) - if floating_ip['fixed_ip']: + if floating_ip.get('fixed_ip'): self.network_api.disassociate_floating_ip(context, address) return webob.Response(status_int=202) -- cgit From aec647b3b42c4cd56a9509c2d1ac25ff12b0664e Mon Sep 17 00:00:00 2001 From: Josh Kearney Date: Thu, 8 Sep 2011 16:10:03 -0500 Subject: First pass at adding reboot_type to reboot codepath. --- nova/api/openstack/servers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index d084ac360..f5447edc5 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -334,9 +334,8 @@ class Controller(object): LOG.exception(msg) raise exc.HTTPBadRequest(explanation=msg) try: - # TODO(gundlach): pass reboot_type, support soft reboot in - # virt driver - self.compute_api.reboot(req.environ['nova.context'], id) + self.compute_api.reboot(req.environ['nova.context'], id, + reboot_type) except Exception, e: LOG.exception(_("Error in reboot %s"), e) raise exc.HTTPUnprocessableEntity() -- cgit From 7352e3e1eb7a4d29b556492a208e80439828f211 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Fri, 9 Sep 2011 09:48:38 -0400 Subject: removing key_name and config_drive from non-detailed server entity --- nova/api/openstack/views/servers.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/views/servers.py b/nova/api/openstack/views/servers.py index ac09b5864..473dc9e7e 100644 --- a/nova/api/openstack/views/servers.py +++ b/nova/api/openstack/views/servers.py @@ -145,6 +145,8 @@ class ViewBuilderV11(ViewBuilder): response['server']['accessIPv4'] = inst.get('access_ip_v4') or "" response['server']['accessIPv6'] = inst.get('access_ip_v6') or "" + response['server']['key_name'] = inst.get('key_name', '') + response['server']['config_drive'] = inst.get('config_drive') return response @@ -185,8 +187,6 @@ class ViewBuilderV11(ViewBuilder): def _build_extra(self, response, inst): self._build_links(response, inst) response['uuid'] = inst['uuid'] - response['key_name'] = inst.get('key_name', '') - self._build_config_drive(response, inst) def _build_links(self, response, inst): href = self.generate_href(inst["id"]) @@ -205,9 +205,6 @@ class ViewBuilderV11(ViewBuilder): response["links"] = links - def _build_config_drive(self, response, inst): - response['config_drive'] = inst.get('config_drive') - def generate_href(self, server_id): """Create an url that refers to a specific server id.""" return os.path.join(self.base_url, self.project_id, -- cgit From 65a0cc41b1b9ead5acd3128a4a6202bb02e3a6e5 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Fri, 9 Sep 2011 17:25:45 -0400 Subject: fixing image status mapping --- nova/api/openstack/views/images.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/views/images.py b/nova/api/openstack/views/images.py index 21f1b2d3e..8983b2957 100644 --- a/nova/api/openstack/views/images.py +++ b/nova/api/openstack/views/images.py @@ -37,17 +37,18 @@ class ViewBuilder(object): def _format_status(self, image): """Update the status field to standardize format.""" status_mapping = { - 'pending': 'QUEUED', - 'decrypting': 'PREPARING', - 'untarring': 'SAVING', - 'available': 'ACTIVE', - 'killed': 'FAILED', + 'active': 'ACTIVE', + 'queued': 'SAVING', + 'saving': 'SAVING', + 'deleted': 'DELETED', + 'pending_delete': 'DELETED', + 'killed': 'ERROR', } try: - image['status'] = status_mapping[image['status']].upper() + image['status'] = status_mapping[image['status']] except KeyError: - image['status'] = image['status'].upper() + image['status'] = 'UNKNOWN' def _build_server(self, image, image_obj): """Indicates that you must use a ViewBuilder subclass.""" -- cgit From 9482275a60ab8caa546ec402f61c60b9f5e7e33f Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Sat, 10 Sep 2011 13:56:54 -0400 Subject: Update GlanceClient, GlanceImageService, and Glance Xen plugin to work with Glance keystone. --- nova/api/auth.py | 1 + nova/api/openstack/create_instance_helper.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/auth.py b/nova/api/auth.py index cd0d38b3f..f73cae01e 100644 --- a/nova/api/auth.py +++ b/nova/api/auth.py @@ -70,6 +70,7 @@ class KeystoneContext(wsgi.Middleware): project_id, roles=roles, auth_token=auth_token, + strategy='keystone', remote_address=remote_address) req.environ['nova.context'] = ctx diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py index 67e669c17..e27ddf78b 100644 --- a/nova/api/openstack/create_instance_helper.py +++ b/nova/api/openstack/create_instance_helper.py @@ -92,7 +92,8 @@ class CreateInstanceHelper(object): if str(image_href).startswith(req.application_url): image_href = image_href.split('/').pop() try: - image_service, image_id = nova.image.get_image_service(image_href) + image_service, image_id = nova.image.get_image_service(context, + image_href) kernel_id, ramdisk_id = self._get_kernel_ramdisk_from_image( req, image_service, image_id) images = set([str(x['id']) for x in image_service.index(context)]) -- cgit