From: Angus Salkeld Date: Tue, 28 May 2013 02:06:28 +0000 (+1000) Subject: Fix the handling of non-existing paste file X-Git-Tag: 2014.1~546 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=38f4de94142c80667f70f1f36b7484bdc42e410a;p=openstack-build%2Fheat-build.git 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 --- 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)