From 55215ac11cc960c61d8efd3f742d31482b52272e Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 27 Jul 2022 09:08:04 -0700 Subject: [PATCH] Set ensure_pip_virtualenv_command in Focal proposal jobs Previously we had this error: No key/value pairs provided, at least one is required for this action to succeed Which appears to be due to the default(omit) condition when setting ensure_pip_virtualenv_command in focal proposal jobs. The issue is default(omit) doesn't do what you think it does when defining a variable. It is really only useful for defining module parameters that may be omitted. Instead we need to call ensure-tox two different ways depending on whether or not we want to override the defaults for ensure_pip_virtualenv_command. One method for Bionic and another for Focal keyed off of whether or not _venv_command is defined. Change-Id: I0cbca64f4a31c8b4eacb5e1c50f2e9fb289ce18e --- playbooks/proposal/pre.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/playbooks/proposal/pre.yaml b/playbooks/proposal/pre.yaml index 8484e8754f..01cf995463 100644 --- a/playbooks/proposal/pre.yaml +++ b/playbooks/proposal/pre.yaml @@ -76,9 +76,17 @@ vars: python_version: 3.9 - - name: Install tox + - name: Install tox with venv command override include_role: name: ensure-tox vars: ensure_global_symlinks: true - ensure_pip_virtualenv_command: '{{ _venv_command | default(omit) }}' + ensure_pip_virtualenv_command: '{{ _venv_command }}' + when: _venv_command is defined + + - name: Install tox without venv command override + include_role: + name: ensure-tox + vars: + ensure_global_symlinks: true + when: _venv_command is not defined