From ee6f2b09b9150de953b0d761130d3610bdd2e984 Mon Sep 17 00:00:00 2001 From: Antti Jaakkola Date: Tue, 6 Jul 2021 13:22:52 +0300 Subject: [PATCH 1/3] Fix for load_plugins() called twice error with dnf --- ansible_mitogen/planner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible_mitogen/planner.py b/ansible_mitogen/planner.py index c0913a3e..95a55440 100644 --- a/ansible_mitogen/planner.py +++ b/ansible_mitogen/planner.py @@ -321,6 +321,7 @@ class NewStylePlanner(ScriptPlanner): ALWAYS_FORK_MODULES = frozenset([ 'dnf', # issue #280; py-dnf/hawkey need therapy 'firewalld', # issue #570: ansible module_utils caches dbus conn + 'ansible.legacy.dnf', # issue #776 ]) def should_fork(self): From 8cbbfaf3c153fb11cbceab4a7aa470c6fb4fe311 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 7 Sep 2021 00:08:37 +0100 Subject: [PATCH 2/3] testlib: Don't assume `docker port` output matches regex --- tests/testlib.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/testlib.py b/tests/testlib.py index e16309ee..019b35d7 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -423,7 +423,10 @@ class DockerizedSshDaemon(object): def _get_container_port(self): s = subprocess__check_output(['docker', 'port', self.container_name]) for line in s.decode().splitlines(): - dport, proto, baddr, bport = self.PORT_RE.match(line).groups() + m = self.PORT_RE.match(line) + if not m: + continue + dport, proto, _, bport = m.groups() if dport == '22' and proto == 'tcp': self.port = int(bport) From 3d350643a9d566d444f874239732e2f1d08d4888 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 7 Sep 2021 01:14:08 +0100 Subject: [PATCH 3/3] tests: Tighten requirements.txt, due to new package releases Attempt to fix Collecting hdrhistogram==0.6.1 (from -r tests/ansible/requirements.txt (line 2)) Downloading https://files.pythonhosted.org/packages/ac/30/2422ad2ad9a5ccfd2e3a8d7a9b98b4fa634945da0047d3b9f73061e8696f/hdrhistogram-0.6.1.tar.gz (61kB) Complete output from command python setup.py egg_info: Couldn't find index page for 'pbr' (maybe misspelled?) sources=['src/python-codec.c'])] File "/usr/lib/python3.5/distutils/core.py", line 108, in setup _setup_distribution = dist = klass(attrs) File "/tmp/venv/lib/python3.5/site-packages/setuptools/dist.py", line 315, in __init__ self.fetch_build_eggs(attrs['setup_requires']) File "/tmp/venv/lib/python3.5/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs replace_conflicting=True, File "/tmp/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 850, in resolve dist = best[req.key] = env.best_match(req, ws, installer) File "/tmp/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1122, in best_match return self.obtain(req, installer) File "/tmp/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1134, in obtain return installer(requirement) File "/tmp/venv/lib/python3.5/site-packages/setuptools/dist.py", line 429, in fetch_build_egg return cmd.easy_install(req) File "/tmp/venv/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 659, in easy_install raise DistutilsError(msg) distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr') --- .ci/prep_azure.py | 6 ++++++ tests/requirements.txt | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.ci/prep_azure.py b/.ci/prep_azure.py index 80dbf485..fd8fb694 100755 --- a/.ci/prep_azure.py +++ b/.ci/prep_azure.py @@ -84,6 +84,12 @@ else: if need_to_fix_psycopg2: venv_steps.append('/tmp/venv/bin/pip3 install psycopg2==2.8.5 psycopg2-binary') +venv_steps.extend([ + # pbr is a transitive setup_requires of hdrhistogram. If it's not already + # installed then setuptools attempts to use easy_install, which fails. + '/tmp/venv/bin/pip install pbr==5.6.0', +]) + batches.append(venv_steps) ci_lib.run_batches(batches) diff --git a/tests/requirements.txt b/tests/requirements.txt index 76e6545d..21ef8166 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -12,6 +12,7 @@ timeoutcontext==1.2.0 unittest2==1.1.0 # Fix InsecurePlatformWarning while creating py26 tox environment # https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings -urllib3[secure]; python_version < '2.7.9' +urllib3[secure]==1.23; python_version < '2.7' +urllib3[secure]==1.26; python_version > '2.6' and python_version < '2.7.9' # Last idna compatible with Python 2.6 was idna 2.7. idna==2.7; python_version < '2.7'