From a0d19d88e6523f2cf33d392faef4c0ce8ef51a08 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 28 Aug 2022 15:43:54 +0000 Subject: [PATCH] [CI] Format code with Black --- src/migrations/0021_migrate_to_bullseye.py | 9 ++++++--- src/tools.py | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/migrations/0021_migrate_to_bullseye.py b/src/migrations/0021_migrate_to_bullseye.py index 0fbf5a5ea..690bc1249 100644 --- a/src/migrations/0021_migrate_to_bullseye.py +++ b/src/migrations/0021_migrate_to_bullseye.py @@ -389,14 +389,17 @@ class MyMigration(Migration): ): try: # Here we try to find the previous migration log, which should be somewhat recent and be at least 10k (we keep the biggest one) - maybe_previous_migration_log_id = check_output("cd /var/log/yunohost/categories/operation && find -name '*migrate*.log' -size +10k -mtime -100 -exec ls -s {} \\; | sort -n | tr './' ' ' | awk '{print $2}' | tail -n 1") + maybe_previous_migration_log_id = check_output( + "cd /var/log/yunohost/categories/operation && find -name '*migrate*.log' -size +10k -mtime -100 -exec ls -s {} \\; | sort -n | tr './' ' ' | awk '{print $2}' | tail -n 1" + ) if maybe_previous_migration_log_id: - logger.info(f"NB: the previous migration log id seems to be {maybe_previous_migration_log_id}. You can share it with the support team with : sudo yunohost log share {maybe_previous_migration_log_id}") + logger.info( + f"NB: the previous migration log id seems to be {maybe_previous_migration_log_id}. You can share it with the support team with : sudo yunohost log share {maybe_previous_migration_log_id}" + ) except Exception: # Yeah it's not that important ... it's to simplify support ... pass - raise YunohostError("migration_0021_not_buster2") # Have > 1 Go free space on /var/ ? diff --git a/src/tools.py b/src/tools.py index 0980488ed..e739c4504 100644 --- a/src/tools.py +++ b/src/tools.py @@ -219,7 +219,9 @@ def tools_postinstall( ) # Check there's at least 10 GB on the rootfs... - disk_partitions = sorted(psutil.disk_partitions(all=True), key=lambda k: k.mountpoint) + disk_partitions = sorted( + psutil.disk_partitions(all=True), key=lambda k: k.mountpoint + ) main_disk_partitions = [d for d in disk_partitions if d.mountpoint in ["/", "/var"]] main_space = sum( psutil.disk_usage(d.mountpoint).total for d in main_disk_partitions