Fix storage variable assignment in echo_storage_summary_from_file
Corrects the logic for setting TEMPLATE_STORAGE and CONTAINER_STORAGE by checking if tpl and ct are set, respectively, and calling choose_and_set_storage_for_file if not. This ensures storage variables are properly initialized before use.
This commit is contained in:
parent
6c9d1d0e23
commit
b678f8828a
@ -1809,10 +1809,17 @@ echo_storage_summary_from_file() {
|
|||||||
local ct_store tpl_store
|
local ct_store tpl_store
|
||||||
ct_store=$(awk -F= '/^var_container_storage=/ {print $2; exit}' "$vars_file")
|
ct_store=$(awk -F= '/^var_container_storage=/ {print $2; exit}' "$vars_file")
|
||||||
tpl_store=$(awk -F= '/^var_template_storage=/ {print $2; exit}' "$vars_file")
|
tpl_store=$(awk -F= '/^var_template_storage=/ {print $2; exit}' "$vars_file")
|
||||||
|
if [ -n "$tpl" ]; then
|
||||||
|
TEMPLATE_STORAGE="$tpl"
|
||||||
|
else
|
||||||
|
choose_and_set_storage_for_file "$vf" template
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "\n${INFO}${BOLD}${DGN}Storage settings from ${vars_file}:${CL}"
|
if [ -n "$ct" ]; then
|
||||||
echo -e " 📦 Container Storage: ${BGN}${ct_store:-<unset>}${CL}"
|
CONTAINER_STORAGE="$ct"
|
||||||
echo -e " 📦 Template Storage: ${BGN}${tpl_store:-<unset>}${CL}\n"
|
else
|
||||||
|
choose_and_set_storage_for_file "$vf" container
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user