From e6b6ac0869bf3852787bef597a6633232e2eed47 Mon Sep 17 00:00:00 2001 From: Kaushik Chandrashekar Date: Fri, 14 Jun 2013 05:47:11 -0500 Subject: Adding fixed_ip in create.end notification Sending the network information for an instance in the create.end notification. Fixes bug 1185076 Change-Id: Iabe088ed23736d7b1ee97624761445023aab22c2 --- nova/compute/manager.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 42f8029a5..cc17b7fb9 100755 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -850,7 +850,7 @@ class ComputeManager(manager.SchedulerDependentManager): extra_usage_info = {} - def notify(status, msg=None): + def notify(status, msg=None, **kwargs): """Send a create.{start,error,end} notification.""" type_ = "create.%(status)s" % dict(status=status) info = extra_usage_info.copy() @@ -858,7 +858,7 @@ class ComputeManager(manager.SchedulerDependentManager): msg = "" info['message'] = msg self._notify_about_instance_usage(context, instance, type_, - extra_usage_info=info) + extra_usage_info=info, **kwargs) try: image_meta = self._prebuild_instance(context, instance) @@ -867,10 +867,11 @@ class ComputeManager(manager.SchedulerDependentManager): notify("start") # notify that build is starting - instance = self._build_instance(context, request_spec, - filter_properties, requested_networks, injected_files, - admin_password, is_first_time, node, instance, image_meta) - notify("end", msg=_("Success")) # notify that build is done + instance, network_info = self._build_instance(context, + request_spec, filter_properties, requested_networks, + injected_files, admin_password, is_first_time, node, + instance, image_meta) + notify("end", msg=_("Success"), network_info=network_info) except exception.RescheduledException as e: # Instance build encountered an error, and has been rescheduled. @@ -1002,7 +1003,7 @@ class ComputeManager(manager.SchedulerDependentManager): raise exc_info[0], exc_info[1], exc_info[2] # spawn success - return instance + return instance, network_info def _log_original_error(self, exc_info, instance_uuid): type_, value, tb = exc_info -- cgit