diff options
Diffstat (limited to 'ansible_collections/community/postgresql/tests/utils')
3 files changed, 7 insertions, 9 deletions
diff --git a/ansible_collections/community/postgresql/tests/utils/shippable/check_matrix.py b/ansible_collections/community/postgresql/tests/utils/shippable/check_matrix.py index 608db6923..e0115c124 100755 --- a/ansible_collections/community/postgresql/tests/utils/shippable/check_matrix.py +++ b/ansible_collections/community/postgresql/tests/utils/shippable/check_matrix.py @@ -1,6 +1,7 @@ #!/usr/bin/env python """Verify the currently executing Shippable test matrix matches the one defined in the "shippable.yml" file.""" -from __future__ import (absolute_import, division, print_function) +from __future__ import absolute_import, division, print_function + __metaclass__ = type import datetime @@ -15,12 +16,7 @@ try: except ImportError: NoReturn = None -try: - # noinspection PyCompatibility - from urllib2 import urlopen # pylint: disable=ansible-bad-import-from -except ImportError: - # noinspection PyCompatibility - from urllib.request import urlopen +from ansible.module_utils.urls import open_url def main(): # type: () -> None @@ -47,7 +43,7 @@ def main(): # type: () -> None for attempts_remaining in range(4, -1, -1): try: - jobs = json.loads(urlopen('https://api.shippable.com/jobs?runIds=%s' % run_id).read()) + jobs = json.loads(open_url('https://api.shippable.com/jobs?runIds=%s' % run_id).read()) if not isinstance(jobs, list): raise Exception('Shippable run %s data is not a list.' % run_id) diff --git a/ansible_collections/community/postgresql/tests/utils/shippable/shippable.sh b/ansible_collections/community/postgresql/tests/utils/shippable/shippable.sh index b181297f9..818324edd 100755 --- a/ansible_collections/community/postgresql/tests/utils/shippable/shippable.sh +++ b/ansible_collections/community/postgresql/tests/utils/shippable/shippable.sh @@ -59,6 +59,7 @@ else retry pip install "https://github.com/ansible/ansible/archive/stable-${ansible_version}.tar.gz" --disable-pip-version-check fi +# shellcheck disable=SC2153 if [ "${SHIPPABLE_BUILD_ID:-}" ]; then export ANSIBLE_COLLECTIONS_PATHS="${HOME}/.ansible" SHIPPABLE_RESULT_DIR="$(pwd)/shippable" diff --git a/ansible_collections/community/postgresql/tests/utils/shippable/timing.py b/ansible_collections/community/postgresql/tests/utils/shippable/timing.py index fb538271b..c6bf15532 100755 --- a/ansible_collections/community/postgresql/tests/utils/shippable/timing.py +++ b/ansible_collections/community/postgresql/tests/utils/shippable/timing.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3.7 -from __future__ import (absolute_import, division, print_function) +from __future__ import absolute_import, division, print_function + __metaclass__ = type import sys |