diff options
author | Ryota MIBU <r-mibu@cq.jp.nec.com> | 2016-02-19 18:02:21 +0900 |
---|---|---|
committer | Dan Radez <dradez@redhat.com> | 2016-02-26 15:11:35 +0000 |
commit | bc0733cb7611c8175463b048ba3139c3d634bfb1 (patch) | |
tree | 264ffef9090c7c1df5536f3f56c118cc867fd936 | |
parent | 7339eac45332e9d90e4eafac04e5c1321109fba3 (diff) |
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 <r-mibu@cq.jp.nec.com>
(cherry picked from commit 034166ea6f9330310789407d8a124812042f305d)
-rwxr-xr-x | ci/deploy.sh | 51 |
1 files changed, 24 insertions, 27 deletions
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 |