Merge "Remove redundant call to add_instance_fault_from_exc in rebuild_instance"

This commit is contained in:
Zuul 2018-02-09 12:29:24 +00:00 committed by Gerrit Code Review
commit 35b8ed987e
2 changed files with 0 additions and 6 deletions

View File

@ -17,7 +17,6 @@
import contextlib
import copy
import functools
import sys
from oslo_config import cfg
from oslo_log import log as logging
@ -968,8 +967,6 @@ class ComputeTaskManager(base.Base):
'task_state': None}, ex, request_spec)
LOG.warning('Rebuild failed: %s',
six.text_type(ex), instance=instance)
compute_utils.add_instance_fault_from_exc(context,
instance, ex, sys.exc_info())
compute_utils.notify_about_instance_usage(
self.notifier, context, instance, "rebuild.scheduled")

View File

@ -1353,7 +1353,6 @@ class _BaseTaskTestCase(object):
set_vm_state_and_notify_mock.call_args[0][4]['vm_state'],
vm_states.ERROR)
self.assertFalse(rebuild_mock.called)
self.assertIn('No valid host', inst_obj.fault.message)
@mock.patch.object(conductor_manager.compute_rpcapi.ComputeAPI,
'rebuild_instance')
@ -1400,8 +1399,6 @@ class _BaseTaskTestCase(object):
exception, mock.ANY)
self.assertFalse(select_dest_mock.called)
self.assertFalse(rebuild_mock.called)
self.assertIn('ServerGroup policy is not supported',
inst_obj.fault.message)
# Assert the migration status was updated.
migration = objects.Migration.get_by_id(self.context, migration.id)