Commit 14719a6f by Chen Zhidong

Add judgment to to fix path0 if ANSIBLE_CONFIG is set to a dir

parent 46d7f528
...@@ -65,6 +65,8 @@ def load_config_file(): ...@@ -65,6 +65,8 @@ def load_config_file():
path0 = os.getenv("ANSIBLE_CONFIG", None) path0 = os.getenv("ANSIBLE_CONFIG", None)
if path0 is not None: if path0 is not None:
path0 = os.path.expanduser(path0) path0 = os.path.expanduser(path0)
if os.path.isdir(path0):
path0 += "/ansible.cfg"
path1 = os.getcwd() + "/ansible.cfg" path1 = os.getcwd() + "/ansible.cfg"
path2 = os.path.expanduser("~/.ansible.cfg") path2 = os.path.expanduser("~/.ansible.cfg")
path3 = "/etc/ansible/ansible.cfg" path3 = "/etc/ansible/ansible.cfg"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment