Skip to content

Commit c3c91c4

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Minor fixes for bashate trunk"
2 parents ced2e41 + 7ae9729 commit c3c91c4

File tree

6 files changed

+28
-14
lines changed

6 files changed

+28
-14
lines changed

functions

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ function upload_image {
9494
local path_len
9595

9696
# vmdk adapter type
97-
local vmdk_adapter_type="$(head -25 $image | { grep -a -F -m 1 'ddb.adapterType =' $image || true; })"
97+
local vmdk_adapter_type
98+
vmdk_adapter_type="$(head -25 $image | { grep -a -F -m 1 'ddb.adapterType =' $image || true; })"
9899
vmdk_adapter_type="${vmdk_adapter_type#*\"}"
99100
vmdk_adapter_type="${vmdk_adapter_type%?}"
100101

101102
# vmdk disk type
102-
local vmdk_create_type="$(head -25 $image | { grep -a -F -m 1 'createType=' $image || true; })"
103+
local vmdk_create_type
104+
vmdk_create_type="$(head -25 $image | { grep -a -F -m 1 'createType=' $image || true; })"
103105
vmdk_create_type="${vmdk_create_type#*\"}"
104106
vmdk_create_type="${vmdk_create_type%\"*}"
105107

@@ -109,7 +111,8 @@ function upload_image {
109111
vmdk_disktype="sparse"
110112
elif [[ "$vmdk_create_type" = "monolithicFlat" || "$vmdk_create_type" = "vmfs" ]]; then
111113
# Attempt to retrieve the ``*-flat.vmdk``
112-
local flat_fname="$(head -25 $image | { grep -G 'RW\|RDONLY [0-9]+ FLAT\|VMFS' $image || true; })"
114+
local flat_fname
115+
flat_fname="$(head -25 $image | { grep -G 'RW\|RDONLY [0-9]+ FLAT\|VMFS' $image || true; })"
113116
flat_fname="${flat_fname#*\"}"
114117
flat_fname="${flat_fname%?}"
115118
if [[ -z "$flat_fname" ]]; then
@@ -407,8 +410,10 @@ function ping_check {
407410
function get_instance_ip {
408411
local vm_id=$1
409412
local network_name=$2
410-
local nova_result="$(nova show $vm_id)"
413+
local nova_result
411414
local ip
415+
416+
nova_result="$(nova show $vm_id)"
412417
ip=$(echo "$nova_result" | grep "$network_name" | get_field 2)
413418
if [[ $ip = "" ]];then
414419
echo "$nova_result"

functions-common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ function get_plugin_packages {
12131213
local files_to_parse=""
12141214
local package_dir=""
12151215
for plugin in ${DEVSTACK_PLUGINS//,/ }; do
1216-
local package_dir="$(_get_package_dir ${GITDIR[$plugin]}/devstack/files)"
1216+
package_dir="$(_get_package_dir ${GITDIR[$plugin]}/devstack/files)"
12171217
files_to_parse+=" $package_dir/$plugin"
12181218
done
12191219
echo "$(_parse_package_files $files_to_parse)"

inc/ini-config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ function iniadd {
3030
local option=$3
3131
shift 3
3232

33-
local values="$(iniget_multiline $file $section $option) $@"
33+
local values
34+
values="$(iniget_multiline $file $section $option) $@"
3435
iniset_multiline $sudo $file $section $option $values
3536
$xtrace
3637
}

lib/neutron-legacy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,12 @@ function install_neutron_agent_packages {
713713

714714
# Start running processes, including screen
715715
function start_neutron_service_and_check {
716-
local cfg_file_options="$(determine_config_files neutron-server)"
717716
local service_port=$Q_PORT
718717
local service_protocol=$Q_PROTOCOL
718+
local cfg_file_options
719+
720+
cfg_file_options="$(determine_config_files neutron-server)"
721+
719722
if is_service_enabled tls-proxy; then
720723
service_port=$Q_PORT_INT
721724
service_protocol="http"

tools/xen/functions

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,21 @@ function create_directory_for_kernels {
2323
if [ -d "/boot/guest" ]; then
2424
echo "INFO: /boot/guest directory already exists, using that" >&2
2525
else
26-
local LOCALPATH="$(get_local_sr_path)/os-guest-kernels"
27-
mkdir -p $LOCALPATH
28-
ln -s $LOCALPATH /boot/guest
26+
local local_path
27+
local_path="$(get_local_sr_path)/os-guest-kernels"
28+
mkdir -p $local_path
29+
ln -s $local_path /boot/guest
2930
fi
3031
}
3132

3233
function create_directory_for_images {
3334
if [ -d "/images" ]; then
3435
echo "INFO: /images directory already exists, using that" >&2
3536
else
36-
local LOCALPATH="$(get_local_sr_path)/os-images"
37-
mkdir -p $LOCALPATH
38-
ln -s $LOCALPATH /images
37+
local local_path
38+
local_path="$(get_local_sr_path)/os-images"
39+
mkdir -p $local_path
40+
ln -s $local_path /images
3941
fi
4042
}
4143

@@ -73,7 +75,7 @@ function find_ip_by_name {
7375

7476
if [ -z "$ipaddress" ]; then
7577
sleep $period
76-
((i++))
78+
i=$((i+1))
7779
else
7880
echo $ipaddress
7981
break

tox.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ usedevelop = False
88
install_command = pip install {opts} {packages}
99

1010
[testenv:bashate]
11+
# if you want to test out some changes you have made to bashate
12+
# against devstack, just set BASHATE_INSTALL_PATH=/path/... to your
13+
# modified bashate tree
1114
deps =
1215
{env:BASHATE_INSTALL_PATH:bashate==0.4.0}
1316
whitelist_externals = bash

0 commit comments

Comments
 (0)