From 6d35251cf1a2c4fe0f233ee65cb8f6d7bfb04215 Mon Sep 17 00:00:00 2001 From: Tin Lam Date: Thu, 7 May 2020 10:38:56 -0500 Subject: [PATCH] fix(rally): update cleanup The cleanup script used for router, network, server, and flavor does not account for the first column being the resource ID. Matching via ^[sc]_rally will always result in an empty return. This fix now correctly matches the the name of the second column. This also fixes an issue where rally creates flavor as "private", adding --all so it cleans up the private flavors as well. Change-Id: Id1a0e31e56b51fd92a95e8588d259ce21fa839d6 Signed-off-by: Tin Lam --- neutron/values.yaml | 4 ++-- nova/values.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/neutron/values.yaml b/neutron/values.yaml index 1cda6dd4e6..f443fa5fd4 100644 --- a/neutron/values.yaml +++ b/neutron/values.yaml @@ -793,11 +793,11 @@ conf: force_project_purge: false run_tempest: false clean_up: | - ROUTERS=$(openstack router list -f value | grep -e "^[sc]_rally_" | awk '{ print $1 }') + ROUTERS=$(openstack router list -f value | awk '$2 ~ /^[sc]_rally_/ { print $1 }') if [ -n "$ROUTERS" ]; then echo $ROUTERS | xargs openstack router delete fi - NETWORKS=$(openstack network list -f value | grep -e "^[sc]_rally_" | awk '{ print $1 }') + NETWORKS=$(openstack network list -f value | awk '$2 ~ /^[sc]_rally_/ { print $1 }') if [ -n "$NETWORKS" ]; then echo $NETWORKS | xargs openstack network delete fi diff --git a/nova/values.yaml b/nova/values.yaml index 6fb623753e..69e48025ae 100644 --- a/nova/values.yaml +++ b/nova/values.yaml @@ -617,11 +617,11 @@ conf: rally_tests: run_tempest: false clean_up: | - FLAVORS=$(openstack flavor list -f value | grep -e "^s_rally_" | awk '{ print $1 }') + FLAVORS=$(openstack flavor list -f value --all | awk '$2 ~ /^s_rally_/ { print $1 }') if [ -n "$FLAVORS" ]; then echo $FLAVORS | xargs openstack flavor delete fi - SERVERS=$(openstack server list -f value | grep -e "^s_rally_" | awk '{ print $1 }') + SERVERS=$(openstack server list -f value --all | awk '$2 ~ /^s_rally_/ { print $1 }') if [ -n "$SERVERS" ]; then echo $SERVERS | xargs openstack server delete fi