From e51c24f837b116c033b639ddfcc90ad59b3ddad3 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 8 Nov 2024 06:39:05 +0100 Subject: [PATCH] bundles/powerdns: use *repo* commit time instead of *file* commit time for serial --- bundles/powerdns/items.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundles/powerdns/items.py b/bundles/powerdns/items.py index a0c89d2..329694a 100644 --- a/bundles/powerdns/items.py +++ b/bundles/powerdns/items.py @@ -2,6 +2,7 @@ from datetime import datetime from os import listdir from os.path import isfile, join from subprocess import check_output +from bundlewrap.utils.ui import io zone_path = join(repo.path, 'data', 'powerdns', 'files', 'bind-zones') @@ -79,9 +80,10 @@ if node.metadata.get('powerdns/features/bind', False): continue try: - output = check_output(['git', 'log', '-1', '--pretty=%ci', join(zone_path, zone)]).decode('utf-8').strip() + output = check_output(['git', 'log', '-1', '--pretty=%ci']).decode('utf-8').strip() serial = datetime.strptime(output, '%Y-%m-%d %H:%M:%S %z').strftime('%y%m%d%H%M') - except: + except Exception as e: + io.stderr(f"Error while parsing commit time for {zone} serial: {e!r}") serial = datetime.now().strftime('%y%m%d0000') primary_zones.add(zone)