From fa74f5c59da8e1641d97333d0b8ee6147fb17947 Mon Sep 17 00:00:00 2001 From: Mark Washenberger Date: Thu, 20 Oct 2011 14:31:24 -0400 Subject: Support using server uuids when accessing consoles. This adds support to the nova/console/api.py for instance_ids being uuids. Additionally, it updates the openstack console controller to get around some int() casts and modifies testing to exercise the server-uuid path. Change-Id: I0641f2c4857d0d1e07abc7d70880590741769b9a --- nova/api/openstack/consoles.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/consoles.py b/nova/api/openstack/consoles.py index d42d34069..7d8c0523e 100644 --- a/nova/api/openstack/consoles.py +++ b/nova/api/openstack/consoles.py @@ -54,7 +54,7 @@ class Controller(object): """Returns a list of consoles for this instance""" consoles = self.console_api.get_consoles( req.environ['nova.context'], - int(server_id)) + server_id) return dict(consoles=[_translate_keys(console) for console in consoles]) @@ -62,14 +62,14 @@ class Controller(object): """Creates a new console""" self.console_api.create_console( req.environ['nova.context'], - int(server_id)) + server_id) def show(self, req, server_id, id): """Shows in-depth information on a specific console""" try: console = self.console_api.get_console( req.environ['nova.context'], - int(server_id), + server_id, int(id)) except exception.NotFound: raise exc.HTTPNotFound() @@ -83,7 +83,7 @@ class Controller(object): """Deletes a console""" try: self.console_api.delete_console(req.environ['nova.context'], - int(server_id), + server_id, int(id)) except exception.NotFound: raise exc.HTTPNotFound() -- cgit From 18e43e6b4dffba73dd35afb797dfa4e1d6cd00fe Mon Sep 17 00:00:00 2001 From: Mark Washenberger Date: Mon, 24 Oct 2011 14:28:47 -0400 Subject: Support server uuids with security groups Change-Id: I15dd5a5e26b2d22fa3def75fa950f1155e6911ac --- nova/api/openstack/contrib/security_groups.py | 8 -------- 1 file changed, 8 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/contrib/security_groups.py b/nova/api/openstack/contrib/security_groups.py index dd8333525..cd5561be6 100644 --- a/nova/api/openstack/contrib/security_groups.py +++ b/nova/api/openstack/contrib/security_groups.py @@ -349,10 +349,6 @@ class Security_groups(extensions.ExtensionDescriptor): try: body = input_dict['addSecurityGroup'] group_name = body['name'] - instance_id = int(instance_id) - except ValueError: - msg = _("Server id should be integer") - raise exc.HTTPBadRequest(explanation=msg) except TypeError: msg = _("Missing parameter dict") raise webob.exc.HTTPBadRequest(explanation=msg) @@ -382,10 +378,6 @@ class Security_groups(extensions.ExtensionDescriptor): try: body = input_dict['removeSecurityGroup'] group_name = body['name'] - instance_id = int(instance_id) - except ValueError: - msg = _("Server id should be integer") - raise exc.HTTPBadRequest(explanation=msg) except TypeError: msg = _("Missing parameter dict") raise webob.exc.HTTPBadRequest(explanation=msg) -- cgit