From 692d176cd5e716ad24e6f4fe57f2c345417c0793 Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Tue, 26 Nov 2019 12:42:36 +0000
Subject: [PATCH] Fix kolla_ansible python module check

The kolla-ansible script now (Train+) checks whether the kolla_ansible
python module is installed, and emits the following message if not:

ERROR: kolla_ansible has to be available in the PYTHONPATH (e.g.
installed)

It is supposed to exit 1 if this check fails, but does not.

This change fixes this by removing a subshell from the kolla-ansible
script.

Change-Id: I2c1a7398f2b8f876abcf2508874835154cb4ce57
Closes-Bug: #1854049
---
 tools/kolla-ansible | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/kolla-ansible b/tools/kolla-ansible
index 640a18ce20..5e1cd1edc5 100755
--- a/tools/kolla-ansible
+++ b/tools/kolla-ansible
@@ -120,10 +120,10 @@ LONG_OPTS="help,inventory:,playbook:,skip-tags:,tags:,key:,extra:,verbose,config
 RAW_ARGS="$*"
 ARGS=$(getopt -o "${SHORT_OPTS}" -l "${LONG_OPTS}" --name "$0" -- "$@") || { usage >&2; exit 2; }
 
-python -c 'import kolla_ansible' &>/dev/null || (
+if ! python -c 'import kolla_ansible' &>/dev/null; then
     echo "ERROR: kolla_ansible has to be available in the PYTHONPATH (e.g. installed)" >&2
     exit 1
-)
+fi
 
 eval set -- "$ARGS"
 
-- 
GitLab