diff options
author | Xavier Queralt <xqueralt@redhat.com> | 2013-12-09 15:21:01 +0100 |
---|---|---|
committer | Xavier Queralt <xqueralt@redhat.com> | 2013-12-10 13:42:05 +0100 |
commit | 6037b9cc20a8ab379855370394e108912ea3a0f2 (patch) | |
tree | 3b2c72b3e0e0d0039437da0b965047751e53ce5e /nova/wsgi.py | |
parent | b190c0c3243fcaeb73892c7667e72b2cf51b31de (diff) | |
download | nova-6037b9cc20a8ab379855370394e108912ea3a0f2.tar.gz |
Ensure api_paste_conf is an absolute path
If api_paste_conf is specified as a relative path and the directory from
where the nova-api service is started contains a file with the same
name, the wsgi loader won't try to find the absolute path to that file
which is required when not passing the base directory to the
paste.deploy library.
This change ensures the config_path is an absolute path so it can be
found by the paste.deploy library.
Closes-Bug: #1259183
Change-Id: I0eb6ef1d69d302634b8c842449f997ec10c13933
Diffstat (limited to 'nova/wsgi.py')
-rw-r--r-- | nova/wsgi.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nova/wsgi.py b/nova/wsgi.py index da16608728..9efb136fef 100644 --- a/nova/wsgi.py +++ b/nova/wsgi.py @@ -464,11 +464,14 @@ class Loader(object): :returns: None """ + self.config_path = None + config_path = config_path or CONF.api_paste_config - if os.path.exists(config_path): - self.config_path = config_path - else: + if not os.path.isabs(config_path): self.config_path = CONF.find_file(config_path) + elif os.path.exists(config_path): + self.config_path = config_path + if not self.config_path: raise exception.ConfigNotFound(path=config_path) |