First only call find_file() by it's self so we can check for None
(abspath crashes if you pass it None)
We are already calling abspath at the return, so this
also prevents a double call to abspath.
If return None from _get_deployment_config_file() load_paste_app() will
print out a nice error message.
Change-Id: I451e090b7f08266ca824b5da228dafde55726d94
absolute pathname.
"""
_register_paste_deploy_opts()
- config_path = os.path.abspath(cfg.CONF.find_file(
- cfg.CONF.paste_deploy['api_paste_config']))
+ config_path = cfg.CONF.find_file(
+ cfg.CONF.paste_deploy['api_paste_config'])
+ if config_path is None:
+ return None
return os.path.abspath(config_path)