From 1a5fa5b20895ce58bc33674fbcc57ed03e41fc83 Mon Sep 17 00:00:00 2001 From: Zsolt Ero Date: Thu, 12 Sep 2024 04:12:13 +0200 Subject: [PATCH] logging fixes --- modules/http_host/http_host.py | 6 ++++++ modules/http_host/http_host_lib/sync.py | 4 ---- modules/tile_gen/tile_gen.py | 2 +- modules/tile_gen/tile_gen_lib/set_version.py | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/http_host/http_host.py b/modules/http_host/http_host.py index 1d92a50..8486071 100755 --- a/modules/http_host/http_host.py +++ b/modules/http_host/http_host.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +from datetime import datetime, timezone import click from http_host_lib.assets import ( @@ -14,6 +15,9 @@ from http_host_lib.sync import auto_clean_btrfs, full_sync from http_host_lib.versions import fetch_version_files +now = datetime.now(timezone.utc) + + @click.group() def cli(): """ @@ -96,6 +100,8 @@ def sync(force): On a new server this also takes care of everything, no need to run anything manually. """ + print(f'---\n{now}\nrunning full_sync') + full_sync(force) diff --git a/modules/http_host/http_host_lib/sync.py b/modules/http_host/http_host_lib/sync.py index 9c0d862..d872bed 100644 --- a/modules/http_host/http_host_lib/sync.py +++ b/modules/http_host/http_host_lib/sync.py @@ -16,10 +16,6 @@ def full_sync(force=False): On a new server this also takes care of everything, no need to run anything manually. """ - print('---') - print('running full_sync') - print(datetime.now(timezone.utc)) - assert_linux() assert_sudo() diff --git a/modules/tile_gen/tile_gen.py b/modules/tile_gen/tile_gen.py index ca6a4a1..3144531 100755 --- a/modules/tile_gen/tile_gen.py +++ b/modules/tile_gen/tile_gen.py @@ -69,7 +69,7 @@ def set_version(area, version): Set versions for a given area """ - print(f'{now} starting set-version {area}') + print(f'---\n{now}\nstarting set-version {area}') check_and_set_version(area, version) diff --git a/modules/tile_gen/tile_gen_lib/set_version.py b/modules/tile_gen/tile_gen_lib/set_version.py index da738e9..01a0241 100644 --- a/modules/tile_gen/tile_gen_lib/set_version.py +++ b/modules/tile_gen/tile_gen_lib/set_version.py @@ -12,7 +12,7 @@ def check_and_set_version(area, version): return version = versions[-1] - print(f'---\nLatest version on bucket: {area} {version}') + print(f' Latest version on bucket: {area} {version}') if not check_all_hosts(area, version): return