From 14719a6f08eb67d36d36acb2d3ce0ec3885047a3 Mon Sep 17 00:00:00 2001 From: Chen Zhidong Date: Thu, 14 May 2015 22:02:30 +0800 Subject: [PATCH] Add judgment to to fix path0 if ANSIBLE_CONFIG is set to a dir --- lib/ansible/constants.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index 089de5b7c5b..d09a8da5ca3 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -65,6 +65,8 @@ def load_config_file(): path0 = os.getenv("ANSIBLE_CONFIG", None) if path0 is not None: path0 = os.path.expanduser(path0) + if os.path.isdir(path0): + path0 += "/ansible.cfg" path1 = os.getcwd() + "/ansible.cfg" path2 = os.path.expanduser("~/.ansible.cfg") path3 = "/etc/ansible/ansible.cfg"