From 76d10b70335ec7de10cd4ea4b0d3fbc85ae38624 Mon Sep 17 00:00:00 2001 From: David Moreau-Simard Date: Thu, 26 Oct 2017 18:47:26 -0400 Subject: [PATCH] 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 --- ara/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ara/config.py b/ara/config.py index 9de0f161..e8d7587d 100644 --- a/ara/config.py +++ b/ara/config.py @@ -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')