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:
parent
f137e8fb1f
commit
76d10b7033
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue