mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-28 03:49:09 -07:00
Split argsfile handling into subfunction, attempt to apply argsfile logic to setup
This commit is contained in:
parent
1f53c89b14
commit
3ea9174ed7
2 changed files with 27 additions and 13 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue