From 8e664f2f2234947a939394c38e04340c4d4ad255 Mon Sep 17 00:00:00 2001 From: Takashi NATSUME Date: Mon, 27 Nov 2017 08:21:12 +0900 Subject: [PATCH] Remove unnecessary self.flags and ConfPatcher In 'start_service' of nova.test.TestCase, there is the following statement. self.useFixture(nova_fixtures.ConfPatcher(host=host)) So it is not necessary to set the 'host' parameter in configuration in the outside of 'start_service'. TrivialFix Change-Id: I01e20309df39b24edef91675d2812201d063f66e --- .../functional/notification_sample_tests/test_instance.py | 1 - nova/tests/functional/regressions/test_bug_1595962.py | 1 - nova/tests/functional/test_servers.py | 3 --- 3 files changed, 5 deletions(-) diff --git a/nova/tests/functional/notification_sample_tests/test_instance.py b/nova/tests/functional/notification_sample_tests/test_instance.py index a3560fccf6d7..d7e0b5d7a39d 100644 --- a/nova/tests/functional/notification_sample_tests/test_instance.py +++ b/nova/tests/functional/notification_sample_tests/test_instance.py @@ -46,7 +46,6 @@ class TestInstanceNotificationSampleWithMultipleCompute( # server will boot on host1 fake.set_nodes(['host2']) self.addCleanup(fake.restore_nodes) - self.useFixture(fixtures.ConfPatcher(host='host2')) self.compute2 = self.start_service('compute', host='host2') actions = [ diff --git a/nova/tests/functional/regressions/test_bug_1595962.py b/nova/tests/functional/regressions/test_bug_1595962.py index 7070b94a5ed9..7b007ac57807 100644 --- a/nova/tests/functional/regressions/test_bug_1595962.py +++ b/nova/tests/functional/regressions/test_bug_1595962.py @@ -64,7 +64,6 @@ class TestSerialConsoleLiveMigrate(test.TestCase): self.flags(enabled=False, group="vnc") self.flags(enabled=False, group="spice") self.flags(use_usb_tablet=False, group="libvirt") - self.flags(host="test_compute1") self.start_service('conductor') self.start_service('scheduler') diff --git a/nova/tests/functional/test_servers.py b/nova/tests/functional/test_servers.py index 6378d59fc96c..08f37e7d5138 100644 --- a/nova/tests/functional/test_servers.py +++ b/nova/tests/functional/test_servers.py @@ -1172,7 +1172,6 @@ class ProviderUsageBaseTestCase(test.TestCase, """ fake.set_nodes([host]) self.addCleanup(fake.restore_nodes) - self.flags(host=host) compute = self.start_service('compute', host=host) self.computes[host] = compute return compute @@ -2714,8 +2713,6 @@ class ServerUnshelveSpawnFailTests(ProviderUsageBaseTestCase): def setUp(self): super(ServerUnshelveSpawnFailTests, self).setUp() # We only need one compute service/host/node for these tests. - fake.set_nodes(['host1']) - self.flags(host='host1') self.compute1 = self._start_compute('host1') flavors = self.api.get_flavors()