From 4201b019312aeae237d3a1175f501cbc0c235e3c Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 10 Nov 2011 22:21:00 -0500 Subject: Converting network methods to use instance objects Related to blueprint internal-uuids Change-Id: I04f8f855411658674441a8d0cb7b589dee8b36fa --- nova/api/openstack/contrib/admin_actions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/contrib/admin_actions.py b/nova/api/openstack/contrib/admin_actions.py index 8ed0827b8..5e0c8571f 100644 --- a/nova/api/openstack/contrib/admin_actions.py +++ b/nova/api/openstack/contrib/admin_actions.py @@ -124,7 +124,8 @@ class Admin_actions(extensions.ExtensionDescriptor): """Permit admins to reset networking on an server""" context = req.environ['nova.context'] try: - self.compute_api.reset_network(context, id) + instance = self.compute_api.get(context, id) + self.compute_api.reset_network(context, instance) except Exception: readable = traceback.format_exc() LOG.exception(_("Compute.api::reset_network %s"), readable) @@ -138,7 +139,10 @@ class Admin_actions(extensions.ExtensionDescriptor): """Permit admins to inject network info into a server""" context = req.environ['nova.context'] try: - self.compute_api.inject_network_info(context, id) + instance = self.compute_api.get(context, id) + self.compute_api.inject_network_info(context, instance) + except exception.InstanceNotFound: + raise exc.HTTPNotFound(_("Server not found")) except Exception: readable = traceback.format_exc() LOG.exception(_("Compute.api::inject_network_info %s"), readable) -- cgit