summaryrefslogtreecommitdiff
path: root/test/integration/targets/ansible-galaxy-collection/library/setup_collections.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/ansible-galaxy-collection/library/setup_collections.py')
-rw-r--r--test/integration/targets/ansible-galaxy-collection/library/setup_collections.py15
1 files changed, 4 insertions, 11 deletions
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 423edd9e..f4a51c4b 100644
--- a/test/integration/targets/ansible-galaxy-collection/library/setup_collections.py
+++ b/test/integration/targets/ansible-galaxy-collection/library/setup_collections.py
@@ -77,7 +77,6 @@ RETURN = '''
#
'''
-import datetime
import os
import subprocess
import tarfile
@@ -85,13 +84,13 @@ import tempfile
import yaml
from ansible.module_utils.basic import AnsibleModule
-from ansible.module_utils.common.text.converters import to_bytes
+from ansible.module_utils._text import to_bytes
from functools import partial
from multiprocessing import dummy as threading
from multiprocessing import TimeoutError
-COLLECTIONS_BUILD_AND_PUBLISH_TIMEOUT = 180
+COLLECTIONS_BUILD_AND_PUBLISH_TIMEOUT = 120
def publish_collection(module, collection):
@@ -105,7 +104,6 @@ def publish_collection(module, collection):
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)
- os.mkdir(os.path.join(b_collection_dir, b'meta'))
with open(os.path.join(b_collection_dir, b'README.md'), mode='wb') as fd:
fd.write(b"Collection readme")
@@ -122,8 +120,6 @@ def publish_collection(module, collection):
}
with open(os.path.join(b_collection_dir, b'galaxy.yml'), mode='wb') as fd:
fd.write(to_bytes(yaml.safe_dump(galaxy_meta), errors='surrogate_or_strict'))
- with open(os.path.join(b_collection_dir, b'meta/runtime.yml'), mode='wb') as fd:
- fd.write(b'requires_ansible: ">=1.0.0"')
with tempfile.NamedTemporaryFile(mode='wb') as temp_fd:
temp_fd.write(b"data")
@@ -250,8 +246,7 @@ def run_module():
supports_check_mode=False
)
- start = datetime.datetime.now()
- result = dict(changed=True, results=[], start=str(start))
+ result = dict(changed=True, results=[])
pool = threading.Pool(4)
publish_func = partial(publish_collection, module)
@@ -268,9 +263,7 @@ def run_module():
r['build']['rc'] + r['publish']['rc'] for r in result['results']
))
- end = datetime.datetime.now()
- delta = end - start
- module.exit_json(failed=failed, end=str(end), delta=str(delta), **result)
+ module.exit_json(failed=failed, **result)
def main():