better logging

This commit is contained in:
Zsolt Ero
2024-09-12 13:00:23 +02:00
parent 506f9ce48d
commit 12fe0de684
2 changed files with 3 additions and 3 deletions

View File

@@ -47,7 +47,7 @@ def create_fstab():
mnt_folder.mkdir(exist_ok=True, parents=True)
fstab_new.append(f'{btrfs_file} {mnt_folder} btrfs loop,ro 0 0\n')
print(f' created fstab entry for {btrfs_file} -> {mnt_folder}')
print(f' created fstab entry for {mnt_folder}')
with open('/etc/fstab') as fp:
fstab_orig = [l for l in fp.readlines() if f'{config.mnt_dir}/' not in l]

View File

@@ -81,7 +81,7 @@ def auto_clean_btrfs():
if len(versions_to_keep) == 1 and len(local_versions) >= 2:
versions_to_keep.add(local_versions[-2])
print(f' keeping versions for {area}: {sorted(versions_to_keep)}')
print(f' keeping runs for {area}: {sorted(versions_to_keep)}')
versions_to_remove = set(local_versions).difference(versions_to_keep)
@@ -89,6 +89,6 @@ def auto_clean_btrfs():
# Interesting bit: linux allows us to remove the disk image file for a mount
# while the mount is still being used.
# We delete the disk image, update nginx config and only then unmount the /mnt dir.
print(f' removing version for {area}: {version}')
print(f' removing runs for {area}: {version}')
version_dir = config.runs_dir / area / version
shutil.rmtree(version_dir)