Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANSIBLE_CONFIG take precedence over ./ansible.cfg #1139

Merged
merged 1 commit into from
Sep 29, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/ansible/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def get_config(p, section, key, env_var, default):

def load_config_file():
p = ConfigParser.ConfigParser()
path1 = os.getcwd() + "/ansible.cfg"
path2 = os.path.expanduser(os.environ.get('ANSIBLE_CONFIG', "~/.ansible.cfg"))
path1 = os.path.expanduser(os.environ.get('ANSIBLE_CONFIG', "~/.ansible.cfg"))
path2 = os.getcwd() + "/ansible.cfg"
path3 = "/etc/ansible/ansible.cfg"

if os.path.exists(path1):
Expand All @@ -50,7 +50,7 @@ def load_config_file():
return p

def shell_expand_path(path):
''' shell_expand_path is needed as os.path.expanduser does not work
''' shell_expand_path is needed as os.path.expanduser does not work
when path is None, which is the default for ANSIBLE_PRIVATE_KEY_FILE '''
if path:
path = os.path.expanduser(path)
Expand Down