From 64be3210e6bae709ee88736f2b7554db6e82f28e Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Mon, 12 Oct 2015 13:10:24 +0200 Subject: [PATCH] Don't assume that $i variable won't be overriden in extras.d plugins This causes an incorrect warning about ironic jobs putting an unexpected file in extras.d. Change-Id: I57acf91fba3fe13b3cc8dd739034e146a0b237c4 --- functions-common | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/functions-common b/functions-common index 08e5e7fb35..3e5b3c23a1 100644 --- a/functions-common +++ b/functions-common @@ -1712,13 +1712,14 @@ function run_phase { local mode=$1 local phase=$2 if [[ -d $TOP_DIR/extras.d ]]; then - for i in $TOP_DIR/extras.d/*.sh; do - [[ -r $i ]] && source $i $mode $phase + local extra_plugin_file_name + for extra_plugin_file_name in $TOP_DIR/extras.d/*.sh; do + [[ -r $extra_plugin_file_name ]] && source $extra_plugin_file_name $mode $phase # NOTE(sdague): generate a big warning about using # extras.d in an unsupported way which will let us track # unsupported usage in the gate. local exceptions="50-ironic.sh 60-ceph.sh 80-tempest.sh" - local extra=$(basename $i) + local extra=$(basename $extra_plugin_file_name) if [[ ! ( $exceptions =~ "$extra" ) ]]; then deprecated "extras.d support is being removed in Mitaka-1" deprecated "jobs for project $extra will break after that point"