diff options
| author | Brian Waldon <brian.waldon@rackspace.com> | 2011-11-10 20:45:55 -0500 |
|---|---|---|
| committer | Brian Waldon <brian.waldon@rackspace.com> | 2011-11-11 13:33:55 -0500 |
| commit | 6bd44ccb3a4bf8536f6bca9b81517d2b24c31f14 (patch) | |
| tree | d81fafe50ae620148a0593fba58b44e3fb8fcf89 /nova/compute | |
| parent | fb6a2d15be16f664b2159526fa339019ed4c204a (diff) | |
Converting fixed ip calls to use instance objects
Related to blueprint internal-uuids
Change-Id: Ifad7a6ac39b0455f77602d9744f64425ebb3f49c
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 19 |
1 files changed, 14 insertions, 5 deletions
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): |
