Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix setup_env.sh failure handling (#5442)
Even when using ``set -o errexit``, bash ignores exit codes when they are part of an explicitly tested command. Commands using ``&&`` are considered tested and therefore are not being checked. For example, in the following job we eventually got to the following error: ``` ./setup_env.sh: line 45: unzip: command not found ``` (see https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_assisted-service/5439/pull-ci-openshift-assisted-service-master-edge-e2e-metal-assisted/1694619719769788416) But looking a few lines above, it shows that: ``` dnf install -y --setopt=skip_missing_names_on_install=False unzip diffutils python3-pip genisoimage skopeo Main config did not have a skip_missing_names_on_install attr. before setopt Main config did not have a skip_missing_names_on_install attr. before setopt CentOS Stream 8 - AppStream 55 MB/s | 33 MB 00:00 CentOS Stream 8 - BaseOS 23 MB/s | 41 MB 00:01 CentOS Stream 8 - Extras 68 kB/s | 18 kB 00:00 CentOS Stream 8 - Extras common packages 71 kB/s | 6.8 kB 00:00 Docker CE Stable - x86_64 766 kB/s | 49 kB 00:00 Package genisoimage-1.1.11-39.el8.x86_64 is already installed. Error: Problem: cannot install the best candidate for the job - nothing provides platform-python-pip = 9.0.3-23.el8 needed by python3-pip-9.0.3-23.el8.noarch from appstream (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages) ``` which means we didn't install any of those dependencies (including ``unzip``) and went on for the other instructions. This removes anywhere with the ``&&`` condition (as either way it's not needed, each line should pass to continue with the other ones) and also removes ``get_package_manager`` as we should only use ``dnf`` anywhere.
- Loading branch information