From ce37d88a91c016fdb7f29a9178fb0b08a6a8f1b2 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Thu, 19 May 2011 11:17:20 -0700 Subject: temp --- nova/api/openstack/servers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 12008d44a..738910bc8 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -162,7 +162,7 @@ class Controller(common.OpenstackController): msg = _("Server name is not defined") return exc.HTTPBadRequest(msg) - zone_blob = env.get('blob', None) + zone_blob = env['server'].get('blob') name = env['server']['name'] self._validate_server_name(name) name = name.strip() -- cgit From 27a0d56d921caa700f4aa84fb177c471071f2ddd Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Fri, 20 May 2011 05:02:34 -0700 Subject: temp fixes --- nova/api/openstack/servers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 12008d44a..738910bc8 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -162,7 +162,7 @@ class Controller(common.OpenstackController): msg = _("Server name is not defined") return exc.HTTPBadRequest(msg) - zone_blob = env.get('blob', None) + zone_blob = env['server'].get('blob') name = env['server']['name'] self._validate_server_name(name) name = name.strip() -- cgit From 0ed410621b3c2d621aa3fa52ca7ac46c6a5f0b70 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Mon, 23 May 2011 16:19:12 -0700 Subject: getting closer to working select call --- nova/api/openstack/servers.py | 3 +++ nova/api/openstack/zones.py | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 738910bc8..474695d98 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -189,6 +189,9 @@ class Controller(common.OpenstackController): inst['instance_type'] = inst_type inst['image_id'] = requested_image_id + # TODO(sandy): REMOVE THIS + LOG.debug(_("***** INST = %(inst)s") % locals()) + builder = self._get_view_builder(req) server = builder.build(inst, is_detail=True) server['server']['adminPass'] = password diff --git a/nova/api/openstack/zones.py b/nova/api/openstack/zones.py index 70653dc0e..b9662761d 100644 --- a/nova/api/openstack/zones.py +++ b/nova/api/openstack/zones.py @@ -18,6 +18,7 @@ import urlparse from nova import crypto from nova import db +from nova import exception from nova import flags from nova import log as logging from nova.api.openstack import common @@ -25,11 +26,6 @@ from nova.scheduler import api FLAGS = flags.FLAGS -flags.DEFINE_string('build_plan_encryption_key', - None, - '128bit (hex) encryption key for scheduler build plans.') - - LOG = logging.getLogger('nova.api.openstack.zones') -- cgit From b8fd215635b850bb9c0309fd7e8e723a78250c32 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Tue, 24 May 2011 07:36:32 -0700 Subject: removed most of debugging code --- nova/api/openstack/servers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index f726a3709..f3fa36028 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -190,7 +190,7 @@ class Controller(common.OpenstackController): inst['image_id'] = requested_image_id # TODO(sandy): REMOVE THIS - LOG.debug(_("***** INST = %(inst)s") % locals()) #pep8 + LOG.debug(_("***** API.OPENSTACK.SERVER.CREATE = %(inst)s") % locals()) #pep8 builder = self._get_view_builder(req) server = builder.build(inst, is_detail=True) -- cgit From 48a3ec6e55f029578d5dc8ef7fe2e9fbe0de1b81 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Tue, 24 May 2011 12:05:46 -0700 Subject: more fix up --- nova/api/openstack/servers.py | 1 - nova/api/openstack/zones.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index f3fa36028..8d5e78d3a 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -189,7 +189,6 @@ class Controller(common.OpenstackController): inst['instance_type'] = inst_type inst['image_id'] = requested_image_id - # TODO(sandy): REMOVE THIS LOG.debug(_("***** API.OPENSTACK.SERVER.CREATE = %(inst)s") % locals()) #pep8 builder = self._get_view_builder(req) diff --git a/nova/api/openstack/zones.py b/nova/api/openstack/zones.py index 96a6552b3..f8867f5a4 100644 --- a/nova/api/openstack/zones.py +++ b/nova/api/openstack/zones.py @@ -119,7 +119,7 @@ class Controller(common.OpenstackController): ctx = req.environ['nova.context'] json_specs = json.loads(req.body) specs = json.loads(json_specs) - LOG.debug("INCOMING SELECT '%s'" % specs) + LOG.debug("NOVA.API.OPENSTACK.ZONES.SELECT '%s'" % specs)#pep8 build_plan = api.select(ctx, specs=specs) cooked = self._scrub_build_plan(build_plan) return {"weights": cooked} -- cgit From f4cc59f0d4344deecea59a7276a50d446f1ea2cd Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Wed, 25 May 2011 08:17:50 -0700 Subject: New tests added --- nova/api/openstack/servers.py | 2 -- nova/api/openstack/zones.py | 1 - 2 files changed, 3 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 8d5e78d3a..738910bc8 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -189,8 +189,6 @@ class Controller(common.OpenstackController): inst['instance_type'] = inst_type inst['image_id'] = requested_image_id - LOG.debug(_("***** API.OPENSTACK.SERVER.CREATE = %(inst)s") % locals()) #pep8 - builder = self._get_view_builder(req) server = builder.build(inst, is_detail=True) server['server']['adminPass'] = password diff --git a/nova/api/openstack/zones.py b/nova/api/openstack/zones.py index f8867f5a4..411eb2b54 100644 --- a/nova/api/openstack/zones.py +++ b/nova/api/openstack/zones.py @@ -119,7 +119,6 @@ class Controller(common.OpenstackController): ctx = req.environ['nova.context'] json_specs = json.loads(req.body) specs = json.loads(json_specs) - LOG.debug("NOVA.API.OPENSTACK.ZONES.SELECT '%s'" % specs)#pep8 build_plan = api.select(ctx, specs=specs) cooked = self._scrub_build_plan(build_plan) return {"weights": cooked} -- cgit From f6f98f1fe905443eacbfb036f1b6ff6c6f5d5261 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Wed, 25 May 2011 09:00:13 -0700 Subject: dist-sched-2a merge --- nova/api/openstack/zones.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/zones.py b/nova/api/openstack/zones.py index 78715f1cc..29b7b2279 100644 --- a/nova/api/openstack/zones.py +++ b/nova/api/openstack/zones.py @@ -26,9 +26,6 @@ from nova.scheduler import api FLAGS = flags.FLAGS -flags.DEFINE_string('build_plan_encryption_key', - None, - '128bit (hex) encryption key for scheduler build plans.') LOG = logging.getLogger('nova.api.openstack.zones') -- cgit From 727317333978ac5cf0fb1cd3f86e49e9868f1e19 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Mon, 6 Jun 2011 17:58:40 -0700 Subject: fixed up tests after trunk merge --- nova/api/openstack/zones.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/zones.py b/nova/api/openstack/zones.py index 330aee85f..0f83afb34 100644 --- a/nova/api/openstack/zones.py +++ b/nova/api/openstack/zones.py @@ -58,12 +58,7 @@ def check_encryption_key(func): return wrapped -class Controller(common.OpenstackController): - - _serialization_metadata = { - 'application/xml': { - "attributes": { - "zone": ["id", "api_url", "name", "capabilities"]}}} +class Controller(object): def index(self, req): """Return all zones in brief""" @@ -114,12 +109,12 @@ class Controller(common.OpenstackController): return dict(zone=_scrub_zone(zone)) @check_encryption_key - def select(self, req): + def select(self, req, body): """Returns a weighted list of costs to create instances of desired capabilities.""" ctx = req.environ['nova.context'] - json_specs = json.loads(req.body) - specs = json.loads(json_specs) + print "**** ZONES ", body + specs = json.loads(body) build_plan = api.select(ctx, specs=specs) cooked = self._scrub_build_plan(build_plan) return {"weights": cooked} -- cgit From 225c8cb8843de17abe192b5efc7c0bd9db0b4d75 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Mon, 6 Jun 2011 19:05:31 -0700 Subject: sanity check --- nova/api/openstack/zones.py | 1 - 1 file changed, 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/zones.py b/nova/api/openstack/zones.py index 0f83afb34..b2f7898cb 100644 --- a/nova/api/openstack/zones.py +++ b/nova/api/openstack/zones.py @@ -113,7 +113,6 @@ class Controller(object): """Returns a weighted list of costs to create instances of desired capabilities.""" ctx = req.environ['nova.context'] - print "**** ZONES ", body specs = json.loads(body) build_plan = api.select(ctx, specs=specs) cooked = self._scrub_build_plan(build_plan) -- cgit