Skip to content

Commit 2b46354

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

File tree

1 file changed

+4
-0
lines changed
  • nova/tests/functional/api/openstack/placement/fixtures

1 file changed

+4
-0
lines changed

nova/tests/functional/api/openstack/placement/fixtures/gabbits.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from oslo_config import cfg
1717
from oslo_config import fixture as config_fixture
1818
from oslo_middleware import cors
19+
from oslo_policy import opts as policy_opts
1920
from oslo_utils import uuidutils
2021
from oslotest import output
2122

@@ -75,6 +76,9 @@ def start_fixture(self):
7576
# deploy.py. Without setting some config the group will not
7677
# be present.
7778
CONF.register_opts(cors.CORS_OPTS, 'cors')
79+
# Set default policy opts, otherwise the deploy module can
80+
# NoSuchOptError.
81+
policy_opts.set_defaults(CONF)
7882

7983
# Make sure default_config_files is an empty list, not None.
8084
# If None /etc/nova/nova.conf is read and confuses results.

0 commit comments

Comments
 (0)