Don't try to load the configuration if there's none

load_config_file will return None if there's no ansible.cfg file
found, we need to make sure we're not passing a None object to
ConfigParser, that crashes it.

Change-Id: Idc458d52e934b0b1754d13047d67b49da3e31f1b
This commit is contained in:
David Moreau-Simard 2017-10-26 18:47:26 -04:00
parent f137e8fb1f
commit 76d10b7033
No known key found for this signature in database
GPG Key ID: 33A07694CBB71ECC
1 changed files with 2 additions and 1 deletions

View File

@ -97,7 +97,8 @@ if LooseVersion(ansible_version) < LooseVersion('2.4.0'):
else:
path = find_ini_config_file()
config = configparser.ConfigParser()
config.read(path)
if path is not None:
config.read(path)
# Some defaults need to be based on top of a "processed" ARA_DIR
ARA_DIR = _ara_config(config, 'dir', 'ARA_DIR')