diff options
| author | Jenkins <jenkins@review.openstack.org> | 2011-11-11 21:27:27 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2011-11-11 21:27:27 +0000 |
| commit | 615c4df3201fce7ae95c1b50bcec7f212cfc2aa6 (patch) | |
| tree | 48c2cf2bb2d51f2a621d3175154b8636ebddaf55 /nova/compute | |
| parent | f492fced12078733c8a84e69d222ec52c2fce609 (diff) | |
| parent | 6bd44ccb3a4bf8536f6bca9b81517d2b24c31f14 (diff) | |
Merge "Converting fixed ip calls to use instance objects"
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 7da29eeea..060dcd799 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): |
