Bug fix: match only the scenario name 63/64063/2
authorManuel Buil <mbuil@suse.com>
Fri, 26 Oct 2018 09:36:22 +0000 (11:36 +0200)
committerManuel Buil <mbuil@suse.com>
Fri, 26 Oct 2018 09:41:54 +0000 (09:41 +0000)
Since this week we have two sfc scenarios:

- os-odl-sfc
- os-odl-sfc_osm

When $DEPLOY_SCENARIO=os-odl-sfc, using the current code testing_role
gets two values:
os-odl-sfc
os-odl-sfc_osm

This patch adds '$' character to prevent matching scenarios which
concatenate characters after $DEPLOY_SCENARIO

Change-Id: Ia0782362da04e8b3ecd2ec6f13ccc8c404797fda
Signed-off-by: Manuel Buil <mbuil@suse.com>
xci/files/xci-lib.sh

index cb0751d..ba73077 100644 (file)
@@ -199,7 +199,7 @@ ansible_lint() {
     set -eu
     local playbooks_dir=(xci/playbooks xci/installer/osa/playbooks xci/installer/kubespray/playbooks)
     # Extract role from scenario information
-    local testing_role=$(sed -n "/^- scenario: ${DEPLOY_SCENARIO}/,/^$/p" ${XCI_PATH}/xci/opnfv-scenario-requirements.yml | grep role | rev | cut -d '/' -f -1 | rev)
+    local testing_role=$(sed -n "/^- scenario: ${DEPLOY_SCENARIO}$/,/^$/p" ${XCI_PATH}/xci/opnfv-scenario-requirements.yml | grep role | rev | cut -d '/' -f -1 | rev)
 
     # clear XCI_CACHE
     rm -rf ${XCI_CACHE}/repos/openstack-ansible-tests