diff --git a/test/integration/targets/ansible-galaxy-collection/library/setup_collections.py b/test/integration/targets/ansible-galaxy-collection/library/setup_collections.py index b4e1d0d0e3e..6f1a17f9714 100644 --- a/test/integration/targets/ansible-galaxy-collection/library/setup_collections.py +++ b/test/integration/targets/ansible-galaxy-collection/library/setup_collections.py @@ -56,12 +56,6 @@ options: - The dependencies of the collection. type: dict default: '{}' - wait: - description: - - Whether to wait for each collection's publish step to complete. - - When set to C(no), will only wait on the last publish task. - type: bool - default: false author: - Jordan Borean (@jborean93) ''' @@ -89,6 +83,76 @@ import yaml from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_bytes +from functools import partial +from multiprocessing import dummy as threading + + +def publish_collection(module, collection): + namespace = collection['namespace'] + name = collection['name'] + version = collection['version'] + dependencies = collection['dependencies'] + use_symlink = collection['use_symlink'] + + result = {} + collection_dir = os.path.join(module.tmpdir, "%s-%s-%s" % (namespace, name, version)) + b_collection_dir = to_bytes(collection_dir, errors='surrogate_or_strict') + os.mkdir(b_collection_dir) + + with open(os.path.join(b_collection_dir, b'README.md'), mode='wb') as fd: + fd.write(b"Collection readme") + + galaxy_meta = { + 'namespace': namespace, + 'name': name, + 'version': version, + 'readme': 'README.md', + 'authors': ['Collection author