From d683c5bd212375c9ffc785ab65ee6e68ea913c8b Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 15 Aug 2022 17:00:19 -0700 Subject: [PATCH] ansible-test - Fix Ubuntu 20.04 bootstrapping. (#78551) --- .../ansible-test-ubuntu-bootstrap-fix.yml | 2 ++ .../ansible_test/_util/target/setup/bootstrap.sh | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/ansible-test-ubuntu-bootstrap-fix.yml diff --git a/changelogs/fragments/ansible-test-ubuntu-bootstrap-fix.yml b/changelogs/fragments/ansible-test-ubuntu-bootstrap-fix.yml new file mode 100644 index 00000000000..92666bed73a --- /dev/null +++ b/changelogs/fragments/ansible-test-ubuntu-bootstrap-fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test - Fix bootstrapping of Python 3.9 on Ubuntu 20.04 remotes. diff --git a/test/lib/ansible_test/_util/target/setup/bootstrap.sh b/test/lib/ansible_test/_util/target/setup/bootstrap.sh index 164107300f8..b1be84366e4 100644 --- a/test/lib/ansible_test/_util/target/setup/bootstrap.sh +++ b/test/lib/ansible_test/_util/target/setup/bootstrap.sh @@ -374,12 +374,6 @@ bootstrap_remote_ubuntu() ${pyyaml_pkg} ${resolvelib_pkg} " - - if [ "${platform_version}/${python_version}" = "20.04/3.9" ]; then - # Install pyyaml using pip so libyaml support is available on Python 3.9. - # The OS package install (which is installed by default) only has a .so file for Python 3.8. - pip_install "--upgrade pyyaml" - fi fi while true; do @@ -390,6 +384,14 @@ bootstrap_remote_ubuntu() echo "Failed to install packages. Sleeping before trying again..." sleep 10 done + + if [ "${controller}" ]; then + if [ "${platform_version}/${python_version}" = "20.04/3.9" ]; then + # Install pyyaml using pip so libyaml support is available on Python 3.9. + # The OS package install (which is installed by default) only has a .so file for Python 3.8. + pip_install "--upgrade pyyaml" + fi + fi } bootstrap_docker()