From bc0733cb7611c8175463b048ba3139c3d634bfb1 Mon Sep 17 00:00:00 2001 From: Ryota MIBU Date: Fri, 19 Feb 2016 18:02:21 +0900 Subject: fix bug in ci/build.sh This patch fixes bug in ci/build.sh that cause the following error message: /bin/opnfv-deploy: line 197: [: too many arguments Change-Id: I92419473262a51806baee849669af9b84b94045c Signed-off-by: Ryota MIBU (cherry picked from commit 034166ea6f9330310789407d8a124812042f305d) --- ci/deploy.sh | 51 ++++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 27 deletions(-) (limited to 'ci') diff --git a/ci/deploy.sh b/ci/deploy.sh index c89dd584..218fe9e6 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -194,41 +194,38 @@ for Auto-detection${reset}" done echo -e "${blue}INFO: Detecting Network Specific settings for: ${enabled_network}${reset}" # detect network specific settings - if [ -n $(eval echo \${${enabled_network}_optional_settings}) ]; then - eval "network_specific_settings=\${${enabled_network}_optional_settings}" - for setting in ${network_specific_settings}; do - eval "setting_value=\${${enabled_network}_${setting}}" - if [ -z "${setting_value}" ]; then - if [ -n "$nic_value" ]; then - setting_value=$(eval find_${setting} ${nic_value}) + for setting in $(eval echo \${${enabled_network}_optional_settings}); do + eval "setting_value=\${${enabled_network}_${setting}}" + if [ -z "${setting_value}" ]; then + if [ -n "$nic_value" ]; then + setting_value=$(eval find_${setting} ${nic_value}) + else + setting_value='' + echo -e "${blue}INFO: Skipping Auto-detection, NIC not specified for ${enabled_network}. Attempting Auto-generation...${reset}" + fi + if [ -n "$setting_value" ]; then + eval "${enabled_network}_${setting}=${setting_value}" + echo -e "${blue}INFO: Auto-detection: ${enabled_network}_${setting}: ${setting_value}${reset}" + else + eval "cidr=\${${enabled_network}_cidr}" + if [ -n "$cidr" ]; then + setting_value=$(eval generate_${setting} ${cidr}) else setting_value='' - echo -e "${blue}INFO: Skipping Auto-detection, NIC not specified for ${enabled_network}. Attempting Auto-generation...${reset}" + echo -e "${red}ERROR: Auto-generation failed: required parameter CIDR missing for network ${enabled_network}${reset}" fi if [ -n "$setting_value" ]; then eval "${enabled_network}_${setting}=${setting_value}" - echo -e "${blue}INFO: Auto-detection: ${enabled_network}_${setting}: ${setting_value}${reset}" + echo -e "${blue}INFO: Auto-generated: ${enabled_network}_${setting}: ${setting_value}${reset}" else - eval "cidr=\${${enabled_network}_cidr}" - if [ -n "$cidr" ]; then - setting_value=$(eval generate_${setting} ${cidr}) - else - setting_value='' - echo -e "${red}ERROR: Auto-generation failed: required parameter CIDR missing for network ${enabled_network}${reset}" - fi - if [ -n "$setting_value" ]; then - eval "${enabled_network}_${setting}=${setting_value}" - echo -e "${blue}INFO: Auto-generated: ${enabled_network}_${setting}: ${setting_value}${reset}" - else - echo -e "${red}ERROR: Auto-generation failed: ${setting} not found${reset}" - exit 1 - fi + echo -e "${red}ERROR: Auto-generation failed: ${setting} not found${reset}" + exit 1 fi - else - echo -e "${blue}INFO: ${enabled_network}_${setting}: ${setting_value}${reset}" fi - done - fi + else + echo -e "${blue}INFO: ${enabled_network}_${setting}: ${setting_value}${reset}" + fi + done done } ##parses deploy settings yaml into globals and options array -- cgit 1.2.3-korg