updates to fix the --flat option 53/10553/3
authorDan Radez <dradez@redhat.com>
Wed, 24 Feb 2016 02:24:01 +0000 (21:24 -0500)
committerDan Radez <dradez@redhat.com>
Mon, 29 Feb 2016 20:24:07 +0000 (15:24 -0500)
JIRA: APEX-84

Change-Id: Ic806118c3c3032abff6cebe5c93ad62a6a0a23c7
Signed-off-by: Dan Radez <dradez@redhat.com>
ci/deploy.sh

index 31cd462..8589226 100755 (executable)
@@ -120,7 +120,7 @@ parse_network_settings() {
     elif [ "${network}" == 'admin_network' ]; then
       echo -e "${red}ERROR: You must enable admin_network and configure it explicitly or use auto-detection${reset}"
       exit 1
-    elif [ "${network}" == 'public_network' ]; then
+    elif [[ "${network}" == 'public_network' && "$net_isolation_enabled" == "TRUE" ]]; then
       echo -e "${red}ERROR: You must enable public_network and configure it explicitly or use auto-detection${reset}"
       exit 1
     else
@@ -301,7 +301,7 @@ parse_inventory_file() {
   fi
 
   eval $(parse_yaml $INVENTORY_FILE) || {
-    echo "${red}Failed to parse inventory.yaml. Aborting.${reset}" &&
+    echo "${red}Failed to parse inventory.yaml. Aborting.${reset}"
     exit 1
   }
 
@@ -394,6 +394,7 @@ function configure_deps {
   # If flat we only use admin network
   if [[ "$net_isolation_enabled" == "FALSE" ]]; then
     virsh_enabled_networks="admin_network"
+    enabled_network_list="admin_network"
   # For baremetal we only need to create/attach instack to admin and public
   elif [ "$virtual" == "FALSE" ]; then
     virsh_enabled_networks="admin_network public_network"
@@ -1140,9 +1141,9 @@ parse_cmdline() {
   done
 
   if [[ ! -z "$NETSETS" && "$net_isolation_enabled" == "FALSE" ]]; then
-    echo -e "${red}INFO: Single flat network requested. Ignoring any network settings!${reset}"
-  elif [[ -z "$NETSETS" && "$net_isolation_enabled" == "TRUE" ]]; then
-    echo -e "${red}ERROR: You must provide a network_settings file with -n or use --flat to force a single flat network${reset}"
+    echo -e "${red}INFO: Single flat network requested. Only admin_network settings will be used!${reset}"
+  elif [[ -z "$NETSETS" ]]; then
+    echo -e "${red}ERROR: You must provide a network_settings file with -n.${reset}"
     exit 1
   fi
 
@@ -1187,10 +1188,8 @@ parse_cmdline() {
 
 main() {
   parse_cmdline "$@"
-  if [[ "$net_isolation_enabled" == "TRUE" ]]; then
-    echo -e "${blue}INFO: Parsing network settings file...${reset}"
-    parse_network_settings
-  fi
+  echo -e "${blue}INFO: Parsing network settings file...${reset}"
+  parse_network_settings
   if ! configure_deps; then
     echo -e "${red}Dependency Validation Failed, Exiting.${reset}"
     exit 1