Don't parse config file if it doesn't exist

This commit adds a check before we parse the config file to see if the
config file actually exists. If it doesn't we shouldn't try to parse
it. There is still an issue with one scenario test that uses
testscenarios but it doesn't result in an error code being raised by a
test-list so that can be tracked down separately.

Change-Id: Iac31f2edcfbccf8c06d73c6ca01e30c8319c0485
Closes-Bug: #1369118
This commit is contained in:
Matthew Treinish 2014-10-02 14:36:16 -04:00
parent 437cefd1c3
commit 5440a40d45
1 changed files with 4 additions and 2 deletions

View File

@ -1141,8 +1141,10 @@ class TempestConfigPrivate(object):
# to remove an issue with the config file up to date checker.
if parse_conf:
config_files.append(path)
cfg.CONF([], project='tempest', default_config_files=config_files)
if os.path.isfile(path):
cfg.CONF([], project='tempest', default_config_files=config_files)
else:
cfg.CONF([], project='tempest')
logging.setup('tempest')
LOG = logging.getLogger('tempest')
LOG.info("Using tempest config file %s" % path)