Remove placement config check

Removes a check that prevented compute from starting when config option
placement.[os_]region_name was not set. The check was not appropriate
since that option is not (otherwise) required. The check was originally
added to catch upgrades to Ocata, where placement (newly) needed to be
configured. Since we're well past that point now, the check is no longer
necessary.

Change-Id: I973180d6a384b32838ab61d4e6aaf73c255fd116
Closes-Bug: 1751692
This commit is contained in:
imacdonn 2018-04-17 18:57:24 +00:00
parent e1346ac8ca
commit b3c3f2fda8
4 changed files with 0 additions and 32 deletions

View File

@ -1126,12 +1126,6 @@ class ComputeManager(manager.Manager):
# if the configuration is wrong.
whitelist.Whitelist(CONF.pci.passthrough_whitelist)
# NOTE(sbauza): We want the compute node to hard fail if it won't be
# able to provide its resources to the placement API, or it will not
# be able to be eligible as a destination.
if CONF.placement.region_name is None:
raise exception.PlacementNotConfigured()
self.driver.init_host(host=self.host)
context = nova.context.get_admin_context()
instances = objects.InstanceList.get_by_host(

View File

@ -2207,12 +2207,6 @@ class NeutronAdminCredentialConfigurationInvalid(Invalid):
msg_fmt = _("Networking client is experiencing an unauthorized exception.")
class PlacementNotConfigured(NovaException):
msg_fmt = _("This compute is not configured to talk to the placement "
"service. Configure the [placement] section of nova.conf "
"and restart the service.")
class InvalidEmulatorThreadsPolicy(Invalid):
msg_fmt = _("CPU emulator threads option requested is invalid, "
"given: '%(requested)s', available: '%(available)s'.")

View File

@ -13,7 +13,6 @@
"""Unit tests for ComputeManager()."""
import contextlib
import copy
import datetime
import time
@ -3771,22 +3770,6 @@ class ComputeManagerUnitTestCase(test.NoDBTestCase):
self.assertRaises(exception.PciDeviceInvalidDeviceName,
self.compute.init_host)
def test_init_host_placement_ensures_default_config_is_unset(self):
# Tests that by default the placement config option is unset
# NOTE(sbauza): Just resets the conf opt to the real value and not
# the faked one.
fake_conf = copy.copy(CONF)
fake_conf.clear_default('os_region_name', group='placement')
self.assertIsNone(CONF.placement.os_region_name)
def test_init_host_placement_config_failure(self):
# Tests that we fail init_host if the placement section is
# configured incorrectly.
self.flags(os_region_name=None, group='placement')
self.flags(region_name=None, group='placement')
self.assertRaises(exception.PlacementNotConfigured,
self.compute.init_host)
@mock.patch('nova.compute.manager.ComputeManager._instance_update')
def test_error_out_instance_on_exception_not_implemented_err(self,
inst_update_mock):

View File

@ -76,9 +76,6 @@ class ConfFixture(config_fixture.Config):
# tests.
self.conf.set_default('keep_alive', False, group="wsgi")
# placement group
self.conf.set_default('region_name', 'RegionOne', group='placement')
config.parse_args([], default_config_files=[], configure_db=False,
init_rpc=False)
policy_opts.set_defaults(self.conf)