Skip to content

Commit

Permalink
CB-22380: Modified Salt script for getting DL storage sizes so that i…
Browse files Browse the repository at this point in the history
…t can't return empty values in response.
  • Loading branch information
sxxgrc authored and keyki committed Jul 10, 2023
1 parent 4f0bb03 commit 4c9b6bf
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ getDataSizesForDatabases() {
TRIMMED_DB=$(echo "$DB" | tr -d '"')
if doesDatabaseExist "$TRIMMED_DB" ; then
CUR_DB_SIZE=$(runPSQLCommand "select sum(pg_table_size(quote_ident(tablename)::regclass)) from pg_tables where schemaname not in ('pg_catalog','information_schema');" "$TRIMMED_DB")
RESULT="${RESULT}${DB}:${CUR_DB_SIZE},"
doLog "Size of database ${DB} is ${CUR_DB_SIZE} bytes."
if [ -z "$CUR_DB_SIZE" ]; then
doLog "Unable to get size of database ${DB} even though it seems to exist..."
else
RESULT="${RESULT}${DB}:${CUR_DB_SIZE},"
doLog "Size of database ${DB} is ${CUR_DB_SIZE} bytes."
fi
fi
done

Expand Down

0 comments on commit 4c9b6bf

Please sign in to comment.