Correct tags option position in ansible hook

I made a mistake with the argument ordering, these need to go
before the playbook name

Change-Id: If7d2dc9f9a09d1c9feb78c3a8cbb2980c3e647f4
This commit is contained in:
Steven Hardy 2016-11-15 18:38:17 +00:00 committed by Thomas Herve
parent e8e15adba9
commit 0a93377447
2 changed files with 6 additions and 5 deletions

View File

@ -78,8 +78,8 @@ def main(argv=sys.argv):
'@%s' % vars_filename '@%s' % vars_filename
] ]
if tags: if tags:
cmd.insert(-1, '--tags') cmd.insert(3, '--tags')
cmd.insert(-1, tags) cmd.insert(4, tags)
log.debug('Running %s' % (' '.join(cmd),)) log.debug('Running %s' % (' '.join(cmd),))
try: try:
subproc = subprocess.Popen(cmd, stdout=subprocess.PIPE, subproc = subprocess.Popen(cmd, stdout=subprocess.PIPE,

View File

@ -103,11 +103,12 @@ class HookAnsibleTest(common.RunScriptTest):
expected_args = [ expected_args = [
self.fake_tool_path, self.fake_tool_path,
'-i', '-i',
'localhost,', 'localhost,']
ansible_playbook,
'--extra-vars']
if options: if options:
expected_args += options expected_args += options
expected_args += [
ansible_playbook,
'--extra-vars']
expected_args.append('@%s' % vars_filename) expected_args.append('@%s' % vars_filename)
self.assertEqual(expected_args, state['args']) self.assertEqual(expected_args, state['args'])