From 64ff37e83f804fbe27bae87c92860c73bb8d3ccf Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 21 Jun 2020 20:00:25 -0700 Subject: [PATCH] storage: Don't log exception of disk space check fails When running inside a container, it is not possible to retrieve information about the disk that is mounted on '/'. Ignore errors in such cases. Tests performed: - Inside a container, start the service using freedombox-devel. Every 3 minutes a check for disk space will be done in developer mode. If UDisks is being used as source of information, the free space check will fail with an error logged. - With the changes, the error is not shown. Signed-off-by: Sunil Mohan Adapa Tested-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/storage/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plinth/modules/storage/__init__.py b/plinth/modules/storage/__init__.py index b6d199539..ac1c21fbc 100644 --- a/plinth/modules/storage/__init__.py +++ b/plinth/modules/storage/__init__.py @@ -290,9 +290,7 @@ def warn_about_low_disk_space(request): try: root_info = get_disk_info('/') - except PlinthError as exception: - logger.exception('Error getting information about root partition: %s', - exception) + except PlinthError: return show = False