def init(): """Init an instance of the Enforcer class.""" global _ENFORCER if not _ENFORCER: _ENFORCER = policy.Enforcer() _ENFORCER.load_rules(True)
def init(): """Init an instance of the Enforcer class.""" global _ENFORCER if not _ENFORCER: _ENFORCER = policy.Enforcer() # NOTE: Method _get_policy_path in common.policy can not always locate # neutron policy file (when init() is called in tests), # so set it explicitly. _ENFORCER.policy_path = utils.find_config_file({}, cfg.CONF.policy_file) _ENFORCER.load_rules(True)