From 6bd44ccb3a4bf8536f6bca9b81517d2b24c31f14 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 10 Nov 2011 20:45:55 -0500 Subject: Converting fixed ip calls to use instance objects Related to blueprint internal-uuids Change-Id: Ifad7a6ac39b0455f77602d9744f64425ebb3f49c --- nova/compute/api.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index 2b0db25f4..64884fbde 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1321,17 +1321,26 @@ class API(base.Base): "instance_type_id": new_instance_type['id']}}) @scheduler_api.reroute_compute("add_fixed_ip") - def add_fixed_ip(self, context, instance_id, network_id): + def add_fixed_ip(self, context, instance, network_id): """Add fixed_ip from specified network to given instance.""" - self._cast_compute_message('add_fixed_ip_to_instance', context, + #NOTE(bcwaldon): We need to use the integer id since the + # network manager doesn't support uuids + instance_id = instance['id'] + self._cast_compute_message('add_fixed_ip_to_instance', + context, instance_id, params=dict(network_id=network_id)) @scheduler_api.reroute_compute("remove_fixed_ip") - def remove_fixed_ip(self, context, instance_id, address): + def remove_fixed_ip(self, context, instance, address): """Remove fixed_ip from specified network to given instance.""" - self._cast_compute_message('remove_fixed_ip_from_instance', context, - instance_id, params=dict(address=address)) + #NOTE(bcwaldon): We need to use the integer id since the + # network manager doesn't support uuids + instance_id = instance['id'] + self._cast_compute_message('remove_fixed_ip_from_instance', + context, + instance_id, + params=dict(address=address)) #TODO(tr3buchet): how to run this in the correct zone? def add_network_to_project(self, context, project_id): -- cgit