def setUp(self): super(PolicyFixture, self).setUp() policy_file = paths.state_path_def('etc/nova/placement-policy.yaml') CONF.set_override('policy_file', policy_file, group='placement') placement_policy.reset() placement_policy.init() self.addCleanup(placement_policy.reset)
def setUp(self): super(PolicyFixture, self).setUp() policy_file = paths.state_path_def('etc/placement/policy.yaml') self.conf_fixture.config(group='oslo_policy', policy_file=policy_file) placement_policy.reset() placement_policy.init(self.conf_fixture.conf) self.addCleanup(placement_policy.reset)
def setUp(self): super(PolicyFixture, self).setUp() policy_file = paths.state_path_def('etc/placement/policy.yaml') self.conf_fixture.config(group='oslo_policy', policy_file=policy_file) placement_policy.reset() # because oslo.policy has a nasty habit of modifying the default rules # we provide, we must pass a copy of the rules rather then the rules # themselves placement_policy.init(self.conf_fixture.conf, suppress_deprecation_warnings=True, rules=copy.deepcopy(policies.list_rules())) self.addCleanup(placement_policy.reset)
def setUp(self): super(PlacementPolicyTestCase, self).setUp() config = cfg.ConfigOpts() self.conf_fixture = self.useFixture(config_fixture.Config(config)) conf.register_opts(config) self.ctxt = context.RequestContext(user_id='fake', project_id='fake') self.target = {'user_id': 'fake', 'project_id': 'fake'} # A value is required in the database connection opt for conf to # parse. self.conf_fixture.config(connection='stub', group='placement_database') config([], default_config_files=[]) self.ctxt.config = config policy.reset() self.addCleanup(policy.reset)