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)