@@ -2339,42 +2339,38 @@ def _build_and_run_instance(self, context, instance, image, injected_files,
23392339 with excutils .save_and_reraise_exception ():
23402340 self ._notify_about_instance_usage (context , instance ,
23412341 'create.error' , fault = e )
2342- tb = traceback .format_exc ()
23432342 compute_utils .notify_about_instance_create (
23442343 context , instance , self .host ,
23452344 phase = fields .NotificationPhase .ERROR , exception = e ,
2346- bdms = block_device_mapping , tb = tb )
2345+ bdms = block_device_mapping )
23472346 except exception .ComputeResourcesUnavailable as e :
23482347 LOG .debug (e .format_message (), instance = instance )
23492348 self ._notify_about_instance_usage (context , instance ,
23502349 'create.error' , fault = e )
2351- tb = traceback .format_exc ()
23522350 compute_utils .notify_about_instance_create (
23532351 context , instance , self .host ,
23542352 phase = fields .NotificationPhase .ERROR , exception = e ,
2355- bdms = block_device_mapping , tb = tb )
2353+ bdms = block_device_mapping )
23562354 raise exception .RescheduledException (
23572355 instance_uuid = instance .uuid , reason = e .format_message ())
23582356 except exception .BuildAbortException as e :
23592357 with excutils .save_and_reraise_exception ():
23602358 LOG .debug (e .format_message (), instance = instance )
23612359 self ._notify_about_instance_usage (context , instance ,
23622360 'create.error' , fault = e )
2363- tb = traceback .format_exc ()
23642361 compute_utils .notify_about_instance_create (
23652362 context , instance , self .host ,
23662363 phase = fields .NotificationPhase .ERROR , exception = e ,
2367- bdms = block_device_mapping , tb = tb )
2364+ bdms = block_device_mapping )
23682365 except exception .NoMoreFixedIps as e :
23692366 LOG .warning ('No more fixed IP to be allocated' ,
23702367 instance = instance )
23712368 self ._notify_about_instance_usage (context , instance ,
23722369 'create.error' , fault = e )
2373- tb = traceback .format_exc ()
23742370 compute_utils .notify_about_instance_create (
23752371 context , instance , self .host ,
23762372 phase = fields .NotificationPhase .ERROR , exception = e ,
2377- bdms = block_device_mapping , tb = tb )
2373+ bdms = block_device_mapping )
23782374 msg = _ ('Failed to allocate the network(s) with error %s, '
23792375 'not rescheduling.' ) % e .format_message ()
23802376 raise exception .BuildAbortException (instance_uuid = instance .uuid ,
@@ -2389,11 +2385,10 @@ def _build_and_run_instance(self, context, instance, image, injected_files,
23892385 instance = instance )
23902386 self ._notify_about_instance_usage (context , instance ,
23912387 'create.error' , fault = e )
2392- tb = traceback .format_exc ()
23932388 compute_utils .notify_about_instance_create (
23942389 context , instance , self .host ,
23952390 phase = fields .NotificationPhase .ERROR , exception = e ,
2396- bdms = block_device_mapping , tb = tb )
2391+ bdms = block_device_mapping )
23972392 msg = _ ('Failed to allocate the network(s), not rescheduling.' )
23982393 raise exception .BuildAbortException (instance_uuid = instance .uuid ,
23992394 reason = msg )
@@ -2412,23 +2407,21 @@ def _build_and_run_instance(self, context, instance, image, injected_files,
24122407 exception .RequestedVRamTooHigh ) as e :
24132408 self ._notify_about_instance_usage (context , instance ,
24142409 'create.error' , fault = e )
2415- tb = traceback .format_exc ()
24162410 compute_utils .notify_about_instance_create (
24172411 context , instance , self .host ,
24182412 phase = fields .NotificationPhase .ERROR , exception = e ,
2419- bdms = block_device_mapping , tb = tb )
2413+ bdms = block_device_mapping )
24202414 raise exception .BuildAbortException (instance_uuid = instance .uuid ,
24212415 reason = e .format_message ())
24222416 except Exception as e :
24232417 LOG .exception ('Failed to build and run instance' ,
24242418 instance = instance )
24252419 self ._notify_about_instance_usage (context , instance ,
24262420 'create.error' , fault = e )
2427- tb = traceback .format_exc ()
24282421 compute_utils .notify_about_instance_create (
24292422 context , instance , self .host ,
24302423 phase = fields .NotificationPhase .ERROR , exception = e ,
2431- bdms = block_device_mapping , tb = tb )
2424+ bdms = block_device_mapping )
24322425 raise exception .RescheduledException (
24332426 instance_uuid = instance .uuid , reason = six .text_type (e ))
24342427
@@ -2460,11 +2453,10 @@ def _build_and_run_instance(self, context, instance, image, injected_files,
24602453 with excutils .save_and_reraise_exception ():
24612454 self ._notify_about_instance_usage (context , instance ,
24622455 'create.error' , fault = e )
2463- tb = traceback .format_exc ()
24642456 compute_utils .notify_about_instance_create (
24652457 context , instance , self .host ,
24662458 phase = fields .NotificationPhase .ERROR , exception = e ,
2467- bdms = block_device_mapping , tb = tb )
2459+ bdms = block_device_mapping )
24682460
24692461 self ._update_scheduler_instance_info (context , instance )
24702462 self ._notify_about_instance_usage (context , instance , 'create.end' ,
@@ -3235,13 +3227,11 @@ def _rebuild_default_impl(self, context, instance, image_meta,
32353227 block_device_info = new_block_device_info )
32363228
32373229 def _notify_instance_rebuild_error (self , context , instance , error , bdms ):
3238- tb = traceback .format_exc ()
32393230 self ._notify_about_instance_usage (context , instance ,
32403231 'rebuild.error' , fault = error )
32413232 compute_utils .notify_about_instance_rebuild (
32423233 context , instance , self .host ,
3243- phase = fields .NotificationPhase .ERROR , exception = error , bdms = bdms ,
3244- tb = tb )
3234+ phase = fields .NotificationPhase .ERROR , exception = error , bdms = bdms )
32453235
32463236 @messaging .expected_exceptions (exception .PreserveEphemeralNotSupported )
32473237 @wrap_exception ()
@@ -3748,12 +3738,11 @@ def bad_volumes_callback(bad_devices):
37483738 instance , error , exc_info )
37493739 self ._notify_about_instance_usage (context , instance ,
37503740 'reboot.error' , fault = error )
3751- tb = traceback .format_exc ()
37523741 compute_utils .notify_about_instance_action (
37533742 context , instance , self .host ,
37543743 action = fields .NotificationAction .REBOOT ,
37553744 phase = fields .NotificationPhase .ERROR ,
3756- exception = error , bdms = bdms , tb = tb
3745+ exception = error , bdms = bdms
37573746 )
37583747 ctxt .reraise = False
37593748 else :
@@ -5263,7 +5252,7 @@ def _reschedule_resize_or_reraise(self, context, instance, exc_info,
52635252 action = fields .NotificationAction .RESIZE ,
52645253 phase = fields .NotificationPhase .ERROR ,
52655254 exception = error ,
5266- tb = ',' . join ( traceback . format_exception ( * exc_info )) )
5255+ )
52675256
52685257 if rescheduled :
52695258 self ._log_original_error (exc_info , instance_uuid )
@@ -5276,7 +5265,7 @@ def _reschedule_resize_or_reraise(self, context, instance, exc_info,
52765265 action = fields .NotificationAction .RESIZE ,
52775266 phase = fields .NotificationPhase .ERROR ,
52785267 exception = exc_info [1 ],
5279- tb = ',' . join ( traceback . format_exception ( * exc_info )) )
5268+ )
52805269 else :
52815270 # not re-scheduling
52825271 six .reraise (* exc_info )
@@ -6977,13 +6966,12 @@ def _attach_volume(self, context, instance, bdm):
69776966 exc , instance = instance )
69786967 else :
69796968 self .volume_api .unreserve_volume (context , bdm .volume_id )
6980- tb = traceback .format_exc ()
69816969 compute_utils .notify_about_volume_attach_detach (
69826970 context , instance , self .host ,
69836971 action = fields .NotificationAction .VOLUME_ATTACH ,
69846972 phase = fields .NotificationPhase .ERROR ,
69856973 exception = e ,
6986- volume_id = bdm .volume_id , tb = tb )
6974+ volume_id = bdm .volume_id )
69876975
69886976 info = {'volume_id' : bdm .volume_id }
69896977 self ._notify_about_instance_usage (
@@ -7184,11 +7172,10 @@ def _swap_volume(self, context, instance, bdm, connector,
71847172 except Exception as ex :
71857173 failed = True
71867174 with excutils .save_and_reraise_exception ():
7187- tb = traceback .format_exc ()
71887175 compute_utils .notify_about_volume_swap (
71897176 context , instance , self .host ,
71907177 fields .NotificationPhase .ERROR ,
7191- old_volume_id , new_volume_id , ex , tb )
7178+ old_volume_id , new_volume_id , ex )
71927179 if new_cinfo :
71937180 msg = ("Failed to swap volume %(old_volume_id)s "
71947181 "for %(new_volume_id)s" )
@@ -7497,12 +7484,11 @@ def attach_interface(self, context, instance, network_id, port_id,
74977484 instance = instance )
74987485 self ._deallocate_port_for_instance (context , instance , port_id )
74997486
7500- tb = traceback .format_exc ()
75017487 compute_utils .notify_about_instance_action (
75027488 context , instance , self .host ,
75037489 action = fields .NotificationAction .INTERFACE_ATTACH ,
75047490 phase = fields .NotificationPhase .ERROR ,
7505- exception = ex , tb = tb )
7491+ exception = ex )
75067492
75077493 raise exception .InterfaceAttachFailed (
75087494 instance_uuid = instance .uuid )
0 commit comments