From 39f68fb07db5376ec5ea69e4584f63f9809113c6 Mon Sep 17 00:00:00 2001 From: bkoschicek Date: Mon, 27 Nov 2023 13:50:51 +0100 Subject: [PATCH] print disk space info --- install/Dockerfile | 2 +- openatlas/views/admin.py | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/install/Dockerfile b/install/Dockerfile index 17856673a..a45705426 100644 --- a/install/Dockerfile +++ b/install/Dockerfile @@ -10,7 +10,7 @@ RUN --mount=type=cache,target=/var/cache/apt \ apt install -y --no-install-recommends apache2 libapache2-mod-wsgi-py3 python3-coverage python3-nose exiftran &&\ apt install -y --no-install-recommends iipimage-server libvips-tools &&\ apt install -y --no-install-recommends gettext npm python3-pip git postgresql-client-13 &&\ - apt install -y --no-install-recommends dos2unix locales locales-all w3c-sgml-lib &&\ + apt install -y --no-install-recommends dos2unix locales locales-all w3c-sgml-lib vim nano &&\ mkdir -p /var/www/openatlas /var/www/.cache /var/www/.local /var/www/.npm &&\ chown -R www-data:www-data /var/www/.cache /var/www/.local /var/www/.npm /var/log/apache2 /var/run/apache2 RUN cp -rp /usr/lib/iipimage-server/ /var/www/iipsrv/ &&\ diff --git a/openatlas/views/admin.py b/openatlas/views/admin.py index 25970bc0d..3608a5d8f 100644 --- a/openatlas/views/admin.py +++ b/openatlas/views/admin.py @@ -779,14 +779,13 @@ def get_disk_space_info() -> Optional[dict[str, Any]]: percent_free = 100 - math.ceil(stats.free / (stats.total / 100)) percent_files = math.ceil(files_size / (stats.total / 100)) other_files = stats.total - stats.free - files_size - print({ - 'total': convert_size(stats.total), - 'project': convert_size(files_size), - 'other_files': convert_size(other_files), - 'free': convert_size(stats.free), - 'percent_used': percent_free, - 'percent_project': percent_files, - 'percent_other': 100 - (percent_files + percent_free)}) + print(files_size) + print(stats) + print(stats.free) + print(stats.total) + print(percent_free) + print(percent_files) + print(other_files) return { 'total': convert_size(stats.total), 'project': convert_size(files_size),