From 45696d5dcc2bdf5af8529b9369c89b811c3f1fba Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 14 Mar 2012 19:05:19 -0400 Subject: [PATCH] Split argsfile handling into subfunction, attempt to apply argsfile logic to setup --- setup | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup b/setup index 30e16032381..c10547e553c 100755 --- a/setup +++ b/setup @@ -31,7 +31,13 @@ except ImportError: # load config & template variables -input_data = sys.argv[1:] +if len(sys.argv) == 1: + sys.exit(1) +argfile = sys.argv[1] +if not os.path.exists(argfile): + sys.exit(1) +input_data = open(argfile, 'r').read() + new_options = dict([ x.split('=') for x in input_data ]) ansible_file = new_options.get('metadata', DEFAULT_ANSIBLE_SETUP) ansible_dir = os.path.dirname(ansible_file)