Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DEFAULT_POLICY_FILE = 'policy.yaml'
- OLD_POLICY_FILE = 'policy.json'
- def pick_file(policy_file):
- if policy_file:
- return policy file
- if CONF.policy_file == DEFAULT_POLICY_FILE:
- if os.path.exists(CONF.policy_file):
- return CONF.policy_file
- elif CONF.policy_file == OLD_POLICY_FILE:
- # Do this smarter
- json_backup = CONF.policy_file.replace('yaml', 'json')
- if os.path.exists(json_backup):
- return json_backup
- # Same behavior if no overrides
- return CONF.policy_file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement