From 2b46354d5ab6d59790e69c44bc36a17074155774 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Tue, 21 Aug 2018 14:23:41 +0100 Subject: [PATCH] Set policy_opt defaults in placement gabbi fixture Without this change, tests can intermittently fail with NoSuchOptError when a single process does not have other tests running prior to gabbi tests. This change ensure the opts are registered and defaulted. Change-Id: I1c7e347b6e788928bef96e32c3365d0fdc5ba00f Related-Bug: #1786498 Closes-Bug: #1788176 --- .../functional/api/openstack/placement/fixtures/gabbits.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nova/tests/functional/api/openstack/placement/fixtures/gabbits.py b/nova/tests/functional/api/openstack/placement/fixtures/gabbits.py index 4b6a1c785ba3..12698a8e5de7 100644 --- a/nova/tests/functional/api/openstack/placement/fixtures/gabbits.py +++ b/nova/tests/functional/api/openstack/placement/fixtures/gabbits.py @@ -16,6 +16,7 @@ from gabbi import fixture from oslo_config import cfg from oslo_config import fixture as config_fixture from oslo_middleware import cors +from oslo_policy import opts as policy_opts from oslo_utils import uuidutils from oslotest import output @@ -75,6 +76,9 @@ class APIFixture(fixture.GabbiFixture): # deploy.py. Without setting some config the group will not # be present. CONF.register_opts(cors.CORS_OPTS, 'cors') + # Set default policy opts, otherwise the deploy module can + # NoSuchOptError. + policy_opts.set_defaults(CONF) # Make sure default_config_files is an empty list, not None. # If None /etc/nova/nova.conf is read and confuses results.