From f465198cb0ee1a5bc5da95914a0ae6441689ff75 Mon Sep 17 00:00:00 2001 From: Guillaume Chauvel Date: Mon, 8 Jun 2020 13:46:35 +0200 Subject: [PATCH] ensure-twine: Avoid Reinstalling twine if present On a static node where twine isn't present in the PATH, twine would be always reinstalled even if already present in venv because it's not checked. This patch adds twine pip check, the first matching line is used to get executable path Change-Id: I2c972147269bf717c30f093975ca6349bed68fbe --- roles/ensure-twine/tasks/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ensure-twine/tasks/main.yaml b/roles/ensure-twine/tasks/main.yaml index 4d166b65b..1596c1c69 100644 --- a/roles/ensure-twine/tasks/main.yaml +++ b/roles/ensure-twine/tasks/main.yaml @@ -1,6 +1,6 @@ - name: Check for twine install shell: | - command -v {{ twine_executable }} || exit 1 + command -v {{ twine_executable }} ~/.local/bin/twine || exit 1 args: executable: /bin/bash failed_when: false @@ -8,7 +8,7 @@ - name: Set pypi_twine_executable set_fact: - pypi_twine_executable: "{{ register_twine.stdout }}" + pypi_twine_executable: "{{ register_twine.stdout_lines[0] }}" when: register_twine.rc == 0 - name: Ensure twine is installed