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

Replace - with _ in setup module key names to avoid variable access problems reported in #954 #959

Merged
merged 1 commit into from
Aug 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 library/setup
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def run_setup(module):
facts = ansible_facts()

for (k, v) in facts.items():
setup_options["ansible_%s" % k] = v
setup_options["ansible_%s" % k.replace('-', '_')] = v

# if facter is installed, and we can use --json because
# ruby-json is ALSO installed, include facter data in the JSON
Expand All @@ -614,7 +614,7 @@ def run_setup(module):
facter = False
if facter:
for (k,v) in facter_ds.items():
setup_options["facter_%s" % k] = v
setup_options["facter_%s" % k.replace('-', '_')] = v

# ditto for ohai, but just top level string keys
# because it contains a lot of nested stuff we can't use for
Expand All @@ -632,7 +632,7 @@ def run_setup(module):
if ohai:
for (k,v) in ohai_ds.items():
if type(v) == str or type(v) == unicode:
k2 = "ohai_%s" % k
k2 = "ohai_%s" % k.replace('-', '_')
setup_options[k2] = v

setup_result = {}
Expand Down