diff --git a/dyndomain b/dyndomain index 24318e4..0c24ff8 100755 --- a/dyndomain +++ b/dyndomain @@ -159,17 +159,18 @@ def process_zone(zone, stamp, grace_period, sync_zone): update = { 'add': [], 'delete': [] } for prot in zone: for name in zone[prot]: - add = False + active = False for addr in zone[prot][name]: e = zone[prot][name][addr] - if e['first'] == stamp and not sync_zone: + if e['first'] == stamp: update['add'].append([prot, name, addr]) - add = True + if e['last'] == stamp: + active = True for addr in zone[prot][name]: e = zone[prot][name][addr] - if add and e['last'] < stamp: + if active and e['last'] < stamp: update['delete'].append([prot, name, addr]) - elif not add and stamp - e['last'] > grace_period: + elif not active and stamp - e['last'] > grace_period: update['delete'].append([prot, name, addr]) elif sync_zone: update['add'].append([prot, name, addr])