mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user