From d170c51545120c6d9d5ae85b31da4e5b996e10db Mon Sep 17 00:00:00 2001 From: Timothy Appnel Date: Tue, 28 Aug 2012 19:02:19 -0400 Subject: [PATCH] Replace - with _ in setup module key names to avoid variable access problems reported in #954 --- setup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup b/setup index 5a9ab9bef0c..3ef610ea09e 100755 --- a/setup +++ b/setup @@ -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 @@ -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 @@ -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 = {}