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 loadapp(config, project_name=None): """WSGI application creator for placement. :param config: An olso_config.cfg.ConfigOpts containing placement configuration. :param project_name: oslo_config project name. Ignored, preserved for backwards compatibility """ application = deploy(config) policy.init(config) update_database(config) return application