From cf464dc7f2093ea3d1f831915ce22f54f0d1c90a Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Wed, 1 Jun 2011 17:35:49 -0700 Subject: list --reservation now works across zones --- nova/api/openstack/create_instance_controller.py | 2 -- nova/api/openstack/views/servers.py | 12 +++++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/create_instance_controller.py b/nova/api/openstack/create_instance_controller.py index 786d74e37..edb1a5007 100644 --- a/nova/api/openstack/create_instance_controller.py +++ b/nova/api/openstack/create_instance_controller.py @@ -116,8 +116,6 @@ class OpenstackCreateInstanceController(common.OpenstackController): zone_blob = env['server'].get('blob') reservation_id = env['server'].get('reservation_id') - LOG.exception("******* CREATE_INSTANCE RES_ID=%s of %s" % (reservation_id, env)) - inst_type = instance_types.get_instance_type_by_flavor_id(flavor_id) extra_values = { 'instance_type': inst_type, diff --git a/nova/api/openstack/views/servers.py b/nova/api/openstack/views/servers.py index 0be468edc..0ee461dde 100644 --- a/nova/api/openstack/views/servers.py +++ b/nova/api/openstack/views/servers.py @@ -41,10 +41,13 @@ class ViewBuilder(object): def build(self, inst, is_detail): """Return a dict that represenst a server.""" - if is_detail: - server = self._build_detail(inst) + if inst.get('_is_precooked', False): + server = dict(server=inst) else: - server = self._build_simple(inst) + if is_detail: + server = self._build_detail(inst) + else: + server = self._build_simple(inst) self._build_extra(server, inst) @@ -78,6 +81,9 @@ class ViewBuilder(object): ctxt = nova.context.get_admin_context() compute_api = nova.compute.API() + + # TODO(sandy): Could be a bug here since the instance ID + # may have come from another Zone. if compute_api.has_finished_migration(ctxt, inst['id']): inst_dict['status'] = 'RESIZE-CONFIRM' -- cgit