Browse code

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

Dmitry Tantsur authored on 2015/10/12 20:10:24
Showing 1 changed files
... ...
@@ -1712,13 +1712,14 @@ function run_phase {
1712 1712
     local mode=$1
1713 1713
     local phase=$2
1714 1714
     if [[ -d $TOP_DIR/extras.d ]]; then
1715
-        for i in $TOP_DIR/extras.d/*.sh; do
1716
-            [[ -r $i ]] && source $i $mode $phase
1715
+        local extra_plugin_file_name
1716
+        for extra_plugin_file_name in $TOP_DIR/extras.d/*.sh; do
1717
+            [[ -r $extra_plugin_file_name ]] && source $extra_plugin_file_name $mode $phase
1717 1718
             # NOTE(sdague): generate a big warning about using
1718 1719
             # extras.d in an unsupported way which will let us track
1719 1720
             # unsupported usage in the gate.
1720 1721
             local exceptions="50-ironic.sh 60-ceph.sh 80-tempest.sh"
1721
-            local extra=$(basename $i)
1722
+            local extra=$(basename $extra_plugin_file_name)
1722 1723
             if [[ ! ( $exceptions =~ "$extra" ) ]]; then
1723 1724
                 deprecated "extras.d support is being removed in Mitaka-1"
1724 1725
                 deprecated "jobs for project $extra will break after that point"