From 3bf3255f91aab28aa6915a2836dad77f17312e03 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Wed, 1 Jun 2011 11:52:33 -0700 Subject: basic reservation id support to GET /servers --- nova/api/openstack/servers.py | 34 +++++----------------------------- nova/api/openstack/zones.py | 1 - 2 files changed, 5 insertions(+), 30 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 67b3fd23f..2bfcbac81 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -87,7 +87,11 @@ class Controller(controller.OpenstackCreateInstanceController): builder - the response model builder """ - instance_list = self.compute_api.get_all(req.environ['nova.context']) + reservation_id = req.str_GET.get('reservation_id') + LOG.exception(_(" ************* RESERVATION ID %s"), reservation_id) + instance_list = self.compute_api.get_all( + req.environ['nova.context'], + reservation_id=reservation_id) limited_list = self._limit_items(instance_list, req) builder = self._get_view_builder(req) servers = [builder.build(inst, is_detail)['server'] @@ -132,34 +136,6 @@ class Controller(controller.OpenstackCreateInstanceController): server['server']['adminPass'] = extra_values['password'] return server - def _get_injected_files(self, personality): - """ - Create a list of injected files from the personality attribute - - At this time, injected_files must be formatted as a list of - (file_path, file_content) pairs for compatibility with the - underlying compute service. - """ - injected_files = [] - - for item in personality: - try: - path = item['path'] - contents = item['contents'] - except KeyError as key: - expl = _('Bad personality format: missing %s') % key - raise exc.HTTPBadRequest(explanation=expl) - except TypeError: - expl = _('Bad personality format') - raise exc.HTTPBadRequest(explanation=expl) - try: - contents = base64.b64decode(contents) - except TypeError: - expl = _('Personality content for %s cannot be decoded') % path - raise exc.HTTPBadRequest(explanation=expl) - injected_files.append((path, contents)) - return injected_files - @scheduler_api.redirect_handler def update(self, req, id): """ Updates the server name or password """ diff --git a/nova/api/openstack/zones.py b/nova/api/openstack/zones.py index 687978b08..acd01a1ff 100644 --- a/nova/api/openstack/zones.py +++ b/nova/api/openstack/zones.py @@ -129,7 +129,6 @@ class Controller(controller.OpenstackCreateInstanceController): Returns a reservation ID (a UUID). """ - print "************** IN ZONE BOOT" extra_values, result = \ self.create_instance(req, self.compute_api.create_all_at_once) if extra_values is None: -- cgit