Browse code

Update to bashate 0.3.2

Bashate 0.3.2 has a few new checks -- firstly make sure some of the
plugins have #!/bin/bash, and fix up a couple of "local" changes that
were missed by I9c8912a8fd596535589b207d7fc553b9d951d3fe

Change-Id: I9e4b1c0dc9e0f709d8e76f9c9bf1c9478b2605ed

Ian Wienand authored on 2015/10/19 12:17:18
Showing 8 changed files
... ...
@@ -1746,7 +1746,8 @@ function run_phase {
1746 1746
             # extras.d in an unsupported way which will let us track
1747 1747
             # unsupported usage in the gate.
1748 1748
             local exceptions="50-ironic.sh 60-ceph.sh 80-tempest.sh"
1749
-            local extra=$(basename $extra_plugin_file_name)
1749
+            local extra
1750
+            extra=$(basename $extra_plugin_file_name)
1750 1751
             if [[ ! ( $exceptions =~ "$extra" ) ]]; then
1751 1752
                 deprecated "extras.d support is being removed in Mitaka-1"
1752 1753
                 deprecated "jobs for project $extra will break after that point"
... ...
@@ -2184,14 +2185,21 @@ function time_start {
2184 2184
 # global counter for that name. Errors if that clock had not
2185 2185
 # previously been started.
2186 2186
 function time_stop {
2187
-    local name=$1
2188
-    local start_time=${START_TIME[$name]}
2187
+    local name
2188
+    local end_time
2189
+    local elpased_time
2190
+    local total
2191
+    local start_time
2192
+
2193
+    name=$1
2194
+    start_time=${START_TIME[$name]}
2195
+
2189 2196
     if [[ -z "$start_time" ]]; then
2190 2197
         die $LINENO "Trying to stop the clock on $name, but it was never started"
2191 2198
     fi
2192
-    local end_time=$(date +%s)
2193
-    local elapsed_time=$(($end_time - $start_time))
2194
-    local total=${TOTAL_TIME[$name]:-0}
2199
+    end_time=$(date +%s)
2200
+    elapsed_time=$(($end_time - $start_time))
2201
+    total=${TOTAL_TIME[$name]:-0}
2195 2202
     # reset the clock so we can start it in the future
2196 2203
     START_TIME[$name]=""
2197 2204
     TOTAL_TIME[$name]=$(($total + $elapsed_time))
... ...
@@ -239,7 +239,8 @@ function start_heat {
239 239
     run_process h-eng "$HEAT_BIN_DIR/heat-engine --config-file=$HEAT_CONF"
240 240
 
241 241
     # If the site is not enabled then we are in a grenade scenario
242
-    local enabled_site_file=$(apache_site_config_for heat-api)
242
+    local enabled_site_file
243
+    enabled_site_file=$(apache_site_config_for heat-api)
243 244
     if [ -f ${enabled_site_file} ] && [ "$HEAT_USE_MOD_WSGI" == "True" ]; then
244 245
         enable_apache_site heat-api
245 246
         enable_apache_site heat-api-cfn
... ...
@@ -284,9 +285,12 @@ function _cleanup_heat_apache_wsgi {
284 284
 # _config_heat_apache_wsgi() - Set WSGI config files of Heat
285 285
 function _config_heat_apache_wsgi {
286 286
 
287
-    local heat_apache_conf=$(apache_site_config_for heat-api)
288
-    local heat_cfn_apache_conf=$(apache_site_config_for heat-api-cfn)
289
-    local heat_cloudwatch_apache_conf=$(apache_site_config_for heat-api-cloudwatch)
287
+    local heat_apache_conf
288
+    heat_apache_conf=$(apache_site_config_for heat-api)
289
+    local heat_cfn_apache_conf
290
+    heat_cfn_apache_conf=$(apache_site_config_for heat-api-cfn)
291
+    local heat_cloudwatch_apache_conf
292
+    heat_cloudwatch_apache_conf=$(apache_site_config_for heat-api-cloudwatch)
290 293
     local heat_ssl=""
291 294
     local heat_certfile=""
292 295
     local heat_keyfile=""
... ...
@@ -1,3 +1,5 @@
1
+#!/bin/bash
2
+
1 3
 # Neutron firewall plugin
2 4
 # ---------------------------
3 5
 
... ...
@@ -1,3 +1,5 @@
1
+#!/bin/bash
2
+
1 3
 # Neutron loadbalancer plugin
2 4
 # ---------------------------
3 5
 
... ...
@@ -1,3 +1,5 @@
1
+#!/bin/bash
2
+
1 3
 # Neutron metering plugin
2 4
 # ---------------------------
3 5
 
... ...
@@ -1,3 +1,5 @@
1
+#!/bin/bash
2
+
1 3
 # Neutron VPN plugin
2 4
 # ---------------------------
3 5
 
... ...
@@ -1,2 +1,4 @@
1
+#!/bin/bash
2
+
1 3
 # REVISIT(roeyc): this file left empty so that 'enable_service vmware_nsx'
2 4
 # continues to work.
... ...
@@ -9,7 +9,7 @@ install_command = pip install {opts} {packages}
9 9
 
10 10
 [testenv:bashate]
11 11
 deps =
12
-   {env:BASHATE_INSTALL_PATH:bashate==0.3.1}
12
+   {env:BASHATE_INSTALL_PATH:bashate==0.3.2}
13 13
 whitelist_externals = bash
14 14
 commands = bash -c "find {toxinidir}             \
15 15
          -not \( -type d -name .?\* -prune \)    \ # prune all 'dot' dirs
... ...
@@ -20,12 +20,13 @@ commands = bash -c "find {toxinidir}             \
20 20
          -not -name \*.md                        \
21 21
          \(                                      \
22 22
           -name \*.sh -or                        \
23
-          -name \*rc -or                         \
23
+          -name \*.orig -or                      \
24
+          -name \*rc -or                         \ # openrc files, etc
24 25
           -name functions\* -or                  \
25 26
           -wholename \*/inc/\* -or               \ # /inc files and
26 27
           -wholename \*/lib/\*                   \ # /lib files are shell, but
27 28
          \)                                      \ #   have no extension
28
-         -print0 | xargs -0 bashate -v -iE006"
29
+         -print0 | xargs -0 bashate -v -iE006 -eE005,E042"
29 30
 
30 31
 [testenv:docs]
31 32
 deps =