Fail gracefully if paste config file is missing.
If the paste config file can't be found, fail with a RuntimeError and message instead of a traceback from os.path.abspath. Change-Id: Id8823dbadab06a0de6bb7c235b70c355812ed55e
This commit is contained in:
parent
9462474c14
commit
03da47b5ea
@ -149,6 +149,11 @@ def _get_deployment_config_file(conf):
|
||||
_register_paste_deploy_opts(conf)
|
||||
config_file = conf.paste_deploy.config_file
|
||||
path = _get_paste_config_path(conf) if not config_file else config_file
|
||||
|
||||
if not path:
|
||||
msg = "Unable to locate paste config file for %s." % conf.prog
|
||||
raise RuntimeError(msg)
|
||||
|
||||
return os.path.abspath(path)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user