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
]
if tags:
cmd.insert(-1, '--tags')
cmd.insert(-1, tags)
cmd.insert(3, '--tags')
cmd.insert(4, tags)
log.debug('Running %s' % (' '.join(cmd),))
try:
subproc = subprocess.Popen(cmd, stdout=subprocess.PIPE,

View File

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