Normalize storage pool locale handling (#562)
This commit is contained in:
parent
79dc620b34
commit
4eccf74bf6
1 changed files with 10 additions and 12 deletions
18
install.sh
18
install.sh
|
|
@ -576,11 +576,10 @@ create_lxc_container() {
|
||||||
local idx=1
|
local idx=1
|
||||||
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
local storage_name=$(echo "$line" | awk '{print $1}')
|
local storage_name storage_type avail_gb total_gb used_pct parsed_line
|
||||||
local storage_type=$(echo "$line" | awk '{print $2}')
|
parsed_line=$(LC_NUMERIC=C awk '{printf "%s,%s,%.1f,%.1f,%s", $1, $2, $6/1048576, $4/1048576, $7}' <<< "$line")
|
||||||
local avail_gb=$(echo "$line" | awk '{print $6/1048576}')
|
[[ -z "$parsed_line" ]] && continue
|
||||||
local total_gb=$(echo "$line" | awk '{print $4/1048576}')
|
IFS=',' read -r storage_name storage_type avail_gb total_gb used_pct <<< "$parsed_line" || continue
|
||||||
local used_pct=$(echo "$line" | awk '{print $7}')
|
|
||||||
|
|
||||||
storage_names+=("$storage_name")
|
storage_names+=("$storage_name")
|
||||||
LC_ALL=C printf " %d) %-15s %-8s %6.1f GB free of %6.1f GB (%s used)\n" \
|
LC_ALL=C printf " %d) %-15s %-8s %6.1f GB free of %6.1f GB (%s used)\n" \
|
||||||
|
|
@ -716,11 +715,10 @@ create_lxc_container() {
|
||||||
local idx=1
|
local idx=1
|
||||||
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
local storage_name=$(echo "$line" | awk '{print $1}')
|
local storage_name storage_type avail_gb total_gb used_pct parsed_line
|
||||||
local storage_type=$(echo "$line" | awk '{print $2}')
|
parsed_line=$(LC_NUMERIC=C awk '{printf "%s,%s,%.1f,%.1f,%s", $1, $2, $6/1048576, $4/1048576, $7}' <<< "$line")
|
||||||
local avail_gb=$(echo "$line" | awk '{print $6/1048576}')
|
[[ -z "$parsed_line" ]] && continue
|
||||||
local total_gb=$(echo "$line" | awk '{print $4/1048576}')
|
IFS=',' read -r storage_name storage_type avail_gb total_gb used_pct <<< "$parsed_line" || continue
|
||||||
local used_pct=$(echo "$line" | awk '{print $7}')
|
|
||||||
|
|
||||||
storage_names+=("$storage_name")
|
storage_names+=("$storage_name")
|
||||||
LC_ALL=C printf " %d) %-15s %-8s %6.1f GB free of %6.1f GB (%s used)\n" \
|
LC_ALL=C printf " %d) %-15s %-8s %6.1f GB free of %6.1f GB (%s used)\n" \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue