summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-07-30 21:59:56 +0000
committerGerrit Code Review <review@openstack.org>2012-07-30 21:59:56 +0000
commitd56b5fc3ad6dbfc56e0729174925fb146cef87fa (patch)
treede2fa52c66683f2d360c3e747588a010696da272 /nova/compute
parent16b7e07066446bdafc778ccb6c723783f80c0452 (diff)
parent96134f9e34faf7e4be1776b24c8d8d661a23342a (diff)
Merge "Send a full instance in remove_fixed_ip_from_instance."
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/manager.py18
-rw-r--r--nova/compute/rpcapi.py8
2 files changed, 16 insertions, 10 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 5a3dfa964..688b2317c 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -272,7 +272,7 @@ def _get_image_meta(context, image_ref):
class ComputeManager(manager.SchedulerDependentManager):
"""Manages the running instances from creation to destruction."""
- RPC_API_VERSION = '1.24'
+ RPC_API_VERSION = '1.25'
def __init__(self, compute_driver=None, *args, **kwargs):
"""Load configuration options and connect to the hypervisor."""
@@ -1679,25 +1679,27 @@ class ComputeManager(manager.SchedulerDependentManager):
@exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
@wrap_instance_fault
- def remove_fixed_ip_from_instance(self, context, instance_uuid, address):
+ def remove_fixed_ip_from_instance(self, context, address, instance=None,
+ instance_uuid=None):
"""Calls network_api to remove existing fixed_ip from instance
by injecting the altered network info and resetting
instance networking.
"""
- instance_ref = self.db.instance_get_by_uuid(context, instance_uuid)
+ if not instance:
+ instance = self.db.instance_get_by_uuid(context, instance_uuid)
self._notify_about_instance_usage(
- context, instance_ref, "delete_ip.start")
+ context, instance, "delete_ip.start")
self.network_api.remove_fixed_ip_from_instance(context,
- instance_ref,
+ instance,
address)
network_info = self._inject_network_info(context,
- instance=instance_ref)
- self.reset_network(context, instance_ref['uuid'])
+ instance=instance)
+ self.reset_network(context, instance['uuid'])
self._notify_about_instance_usage(
- context, instance_ref, "delete_ip.end", network_info=network_info)
+ context, instance, "delete_ip.end", network_info=network_info)
@exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
diff --git a/nova/compute/rpcapi.py b/nova/compute/rpcapi.py
index 11f95f749..70f3da64c 100644
--- a/nova/compute/rpcapi.py
+++ b/nova/compute/rpcapi.py
@@ -92,6 +92,8 @@ class ComputeAPI(nova.openstack.common.rpc.proxy.RpcProxy):
pre_live_migration()
1.24 - Remove instance_uuid, add instance argument to
rebuild_instance()
+ 1.25 - Remove instance_uuid, add instance argument to
+ remove_fixed_ip_from_instance()
'''
BASE_RPC_API_VERSION = '1.0'
@@ -326,9 +328,11 @@ class ComputeAPI(nova.openstack.common.rpc.proxy.RpcProxy):
topic=_compute_topic(self.topic, ctxt, host, None))
def remove_fixed_ip_from_instance(self, ctxt, instance, address):
+ instance_p = jsonutils.to_primitive(instance)
self.cast(ctxt, self.make_msg('remove_fixed_ip_from_instance',
- instance_uuid=instance['uuid'], address=address),
- topic=_compute_topic(self.topic, ctxt, None, instance))
+ instance=instance_p, address=address),
+ topic=_compute_topic(self.topic, ctxt, None, instance),
+ version='1.25')
def remove_volume_connection(self, ctxt, instance, volume_id, host):
return self.call(ctxt, self.make_msg('remove_volume_connection',