Starting work on getting integration tests working on v2

This is incomplete work, and requires some minor tweeks to the integration
tests which are not included in this commit.
This commit is contained in:
James Cammarata
2015-01-12 16:04:56 -06:00
parent d7f67ea62b
commit 2aeb79f45f
24 changed files with 189 additions and 155 deletions

View File

@@ -144,6 +144,7 @@ class Cli(object):
dict(action=dict(module=options.module_name, args=parse_kv(options.module_args))),
]
)
play = Play().load(play_ds, variable_manager=variable_manager, loader=loader)
# now create a task queue manager to execute the play
@@ -155,7 +156,7 @@ class Cli(object):
tqm.cleanup()
raise
return (result, len(tqm._failed_hosts), len(tqm._unreachable_hosts))
return result
# ----------------------------------------------
@@ -179,12 +180,7 @@ if __name__ == '__main__':
try:
cli = Cli()
(options, args) = cli.parse()
(result, num_failed, num_unreachable) = cli.run(options, args)
if not result:
if num_failed > 0:
sys.exit(2)
elif num_unreachable > 0:
sys.exit(3)
result = cli.run(options, args)
except AnsibleError, e:
print(e)
@@ -195,3 +191,4 @@ if __name__ == '__main__':
print("ERROR: %s" % str(e))
sys.exit(1)
sys.exit(result)

View File

@@ -143,7 +143,7 @@ def main(args):
# create the playbook executor, which manages running the plays
# via a task queue manager
pbex = PlaybookExecutor(playbooks=args, inventory=inventory, variable_manager=variable_manager, loader=loader, options=options)
pbex.run()
return pbex.run()
if __name__ == "__main__":
#display(" ", log_only=True)