Merge "generate image variable name when generating scenario config"

This commit is contained in:
Jenkins 2016-12-22 06:57:04 +00:00 committed by Gerrit Code Review
commit b775167e98
3 changed files with 6 additions and 12 deletions

View File

@ -105,13 +105,11 @@ case $plugin in
;;
esac
image_variable_name=$(get_image_variable_name $scenario_conf_file)
cd $SAHARA_PATH
sudo pip install . --no-cache-dir
enable_pypi
write_sahara_main_conf "$sahara_conf_file" "$sahara_plugin"
write_tests_conf "$cluster_name" "$image_variable_name" "$image_name" "$scenario_conf_file"
write_tests_conf "$cluster_name" "$image_name" "$scenario_conf_file"
start_sahara "$sahara_conf_file" && run_tests "$scenario_conf_file"
print_python_env
cleanup_image "$plugin" "$os"

View File

@ -164,8 +164,10 @@ write_sahara_main_conf() {
write_tests_conf() {
local cluster_name=$1
local image_variable_name=$2
local image_name=$3
local image_name=$2
local scenario=$3
local image_variable_name
image_variable_name=$(grep image "${scenario}" | awk '{ print $2 }' | sed "s/[{}$]//g")
export NETWORK="neutron"
echo "[DEFAULT]
$image_variable_name: $image_name
@ -191,8 +193,3 @@ get_template_path() {
echo "$base_path/$suffix.yaml.mako"
}
get_image_variable_name() {
local scenario
scenario=$1
grep image < $scenario | awk '{ print $2 }' | sed "s/[{}$]//g"
}

View File

@ -24,7 +24,6 @@ os=$(echo $JOB_NAME | awk -F '-' '{ print $4 }')
image_name=${plugin}_${os}
sahara_plugin=$(echo $plugin | awk -F '_' '{ print $1 } ')
scenario_conf_file=$(get_template_path $ZUUL_BRANCH $plugin $sahara_templates_path)
image_variable_name=$(get_image_variable_name $scenario_conf_file)
case $plugin in
ambari_2.3)
@ -57,6 +56,6 @@ esac
enable_pypi
write_sahara_main_conf "$sahara_conf_file" "$sahara_plugin"
write_tests_conf "$cluster_name" "$image_variable_name" "$image_name" "$scenario_conf_file"
write_tests_conf "$cluster_name" "$image_name" "$scenario_conf_file"
start_sahara "$sahara_conf_file" "$mode" && run_tests "$scenario_conf_file"
print_python_env