From 38f4de94142c80667f70f1f36b7484bdc42e410a Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Tue, 28 May 2013 12:06:28 +1000 Subject: [PATCH] Fix the handling of non-existing paste file 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 --- heat/common/config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/heat/common/config.py b/heat/common/config.py index 628157dd..02ae986c 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -155,8 +155,10 @@ def _get_deployment_config_file(): 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) -- 2.45.2