Allow variable expressions to be stored as variables themselves, do some things to allow setup strings

to more easily contain spaces without being mangled, which is neccessary because of the above.
reviewable/pr18780/r1
Michael DeHaan 13 years ago
parent e48b6b46ee
commit 582f83a995

@ -33,12 +33,18 @@ except ImportError:
if len(sys.argv) == 1:
sys.exit(1)
argfile = sys.argv[1]
if not os.path.exists(argfile):
sys.exit(1)
input_data = shlex.split(open(argfile, 'r').read())
new_options = dict([ x.split('=') for x in input_data ])
# turn urlencoded k=v string (space delimited) to regular k=v directionary
splitted = [x.split('=',1) for x in input_data ]
splitted = [ (x[0], x[1].replace("~~~"," ")) for x in splitted ]
new_options = dict(splitted)
ansible_file = new_options.get('metadata', DEFAULT_ANSIBLE_SETUP)
ansible_dir = os.path.dirname(ansible_file)

Loading…
Cancel
Save