Revert "Deallocate the network if rescheduling for

Revert "Deallocate the network if rescheduling for Ironic"

This reverts commit 963ad71af4.

The original fix, targeted towards Nova BM and Ironic tests
is actually making us have more test failures. Lets go
back to the original race... and then we can have a bit
more time to test a proper fix.

Closes-bug #1346424

Change-Id: Icbbe16ffef69132177165d21c727d791b62a232f
This commit is contained in:
Dan Prince 2014-07-24 12:41:07 -04:00 committed by Chris Behrens
parent 4fcfd609bc
commit 7f65d43b04
2 changed files with 5 additions and 6 deletions

View File

@ -1920,10 +1920,9 @@ class ComputeManager(manager.Manager):
self._set_instance_error_state(context, instance.uuid)
return
retry['exc'] = traceback.format_exception(*sys.exc_info())
# The MAC address for this instance is tied to the host so if
# we're going to reschedule we have to free the network details
# and reallocate on the next host.
if self.driver.macs_for_instance(instance):
# dhcp_options are per host, so if they're set we need to
# deallocate the networks and reallocate on the next host.
if self.driver.dhcp_options_for_instance(instance):
self._cleanup_allocated_networks(context, instance,
requested_networks)

View File

@ -1973,7 +1973,7 @@ class ComputeManagerBuildInstanceTestCase(test.NoDBTestCase):
def test_rescheduled_exception_deallocate_network_if_dhcp(self):
self.mox.StubOutWithMock(self.compute, '_build_and_run_instance')
self.mox.StubOutWithMock(self.compute.driver,
'macs_for_instance')
'dhcp_options_for_instance')
self.mox.StubOutWithMock(self.compute, '_cleanup_allocated_networks')
self.mox.StubOutWithMock(self.compute.compute_task_api,
'build_instances')
@ -1985,7 +1985,7 @@ class ComputeManagerBuildInstanceTestCase(test.NoDBTestCase):
self.filter_properties).AndRaise(
exception.RescheduledException(reason='',
instance_uuid=self.instance['uuid']))
self.compute.driver.macs_for_instance(self.instance).AndReturn(
self.compute.driver.dhcp_options_for_instance(self.instance).AndReturn(
{'fake': 'options'})
self.compute._cleanup_allocated_networks(self.context, self.instance,
self.requested_networks)