From f7c5aca3b2b57547c9f95b8432da60b59d66fadf Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Tue, 21 Aug 2018 16:56:43 +0100 Subject: [PATCH] Set policy_opt defaults in placement deploy unit test Without this change, tests can intermittently fail with NoSuchOptError when a single process does not have the ConfigFixture running before this test. This change ensure the opts are registered and defaulted. Change-Id: I6a4873726e3e7fe0d4db3d1dea61309702b8f24b Closes-Bug: #1788176 --- nova/tests/unit/api/openstack/placement/test_deploy.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nova/tests/unit/api/openstack/placement/test_deploy.py b/nova/tests/unit/api/openstack/placement/test_deploy.py index 6a9facf5ab54..680d92cd187a 100644 --- a/nova/tests/unit/api/openstack/placement/test_deploy.py +++ b/nova/tests/unit/api/openstack/placement/test_deploy.py @@ -14,6 +14,7 @@ """Unit tests for the deply function used to build the Placement service.""" from oslo_config import cfg +from oslo_policy import opts as policy_opts import testtools import webob @@ -34,6 +35,8 @@ class DeployTest(testtools.TestCase): group='keystone_authtoken') # ensure that the auth_token middleware is chosen CONF.set_override('auth_strategy', 'keystone', group='api') + # register and default policy opts (referenced by deploy) + policy_opts.set_defaults(CONF) app = deploy.deploy(CONF) req = webob.Request.blank('/resource_providers', method="GET")