Skip to content

Commit f7c5aca

Browse files
committed
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
1 parent 2b46354 commit f7c5aca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nova/tests/unit/api/openstack/placement/test_deploy.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"""Unit tests for the deply function used to build the Placement service."""
1515

1616
from oslo_config import cfg
17+
from oslo_policy import opts as policy_opts
1718
import testtools
1819
import webob
1920

@@ -34,6 +35,8 @@ def test_auth_middleware_factory(self):
3435
group='keystone_authtoken')
3536
# ensure that the auth_token middleware is chosen
3637
CONF.set_override('auth_strategy', 'keystone', group='api')
38+
# register and default policy opts (referenced by deploy)
39+
policy_opts.set_defaults(CONF)
3740
app = deploy.deploy(CONF)
3841
req = webob.Request.blank('/resource_providers', method="GET")
3942

0 commit comments

Comments
 (0)