X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fparse-functions.sh;h=2114c0b71ecac1cda45f48e4d633012bce53ed8d;hb=78a9d70f7f6a5b0b0f941c849a9250da2181c428;hp=84da75c5037094785f0917e4f268fbc873a4e2a2;hpb=a80018e923eec6e92e841692bc9a42d9740b6d31;p=apex.git diff --git a/lib/parse-functions.sh b/lib/parse-functions.sh index 84da75c5..2114c0b7 100755 --- a/lib/parse-functions.sh +++ b/lib/parse-functions.sh @@ -12,20 +12,9 @@ ##parses network settings yaml into globals parse_network_settings() { - local output parse_ext - parse_ext='' - - if [[ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' || "${deploy_options_array['dataplane']}" == 'fdio' ]]; then - for val in ${performance_roles[@]}; do - if [ "$val" == "Compute" ]; then - parse_ext="${parse_ext} --compute-pre-config " - elif [ "$val" == "Controller" ]; then - parse_ext="${parse_ext} --controller-pre-config " - fi - done - fi + local output - if output=$(python3 -B $LIB/python/apex_python_utils.py parse-net-settings -s $NETSETS -td $APEX_TMP_DIR -e $CONFIG/network-environment.yaml $parse_ext); then + if output=$(python3 -B $LIB/python/apex_python_utils.py parse-net-settings -s $NETSETS -td $APEX_TMP_DIR -e $BASE/network-environment.yaml); then echo -e "${blue}${output}${reset}" eval "$output" else @@ -59,6 +48,7 @@ parse_deploy_settings() { ##params: none ##usage: parse_inventory_file parse_inventory_file() { + local output if [ "$virtual" == "TRUE" ]; then inv_virt="--virtual"; fi if [[ "$ha_enabled" == "True" ]]; then inv_ha="--ha"; fi instackenv_output=$(python3 -B $LIB/python/apex_python_utils.py parse-inventory -f $INVENTORY_FILE $inv_virt $inv_ha) @@ -69,5 +59,12 @@ cat > instackenv.json << EOF $instackenv_output EOF EOI + if output=$(python3 -B $LIB/python/apex_python_utils.py parse-inventory -f $INVENTORY_FILE $inv_virt $inv_ha --export-bash); then + echo -e "${blue}${output}${reset}" + eval "$output" + else + echo -e "${red}ERROR: Failed to parse inventory bash settings file ${INVENTORY_FILE}${reset}" + exit 1 + fi }