Retain routing state until retirement publishes safely
This commit is contained in:
1 parent
0404880176
commit
9a73cc78d6
1 file changed
+4
-2
@@ -146,6 +146,7 @@ def reconcile_routes(records, *, retired=None):
|
|||||||
return
|
return
|
||||||
previous = read_table()
|
previous = read_table()
|
||||||
recipients = managed_recipients(records)
|
recipients = managed_recipients(records)
|
||||||
|
pruned = None
|
||||||
if retired is not None and retired.domain in routes:
|
if retired is not None and retired.domain in routes:
|
||||||
spec = routes[retired.domain]
|
spec = routes[retired.domain]
|
||||||
if any(
|
if any(
|
||||||
@@ -166,6 +167,7 @@ def reconcile_routes(records, *, retired=None):
|
|||||||
spec = MailRouting(spec.domain, aliases, catchall)
|
spec = MailRouting(spec.domain, aliases, catchall)
|
||||||
else:
|
else:
|
||||||
spec = MailRouting(spec.domain, {})
|
spec = MailRouting(spec.domain, {})
|
||||||
routes[spec.domain] = spec
|
routes[spec.domain] = pruned = spec
|
||||||
save_policy(spec)
|
|
||||||
publish_routes(routes, recipients, previous)
|
publish_routes(routes, recipients, previous)
|
||||||
|
if pruned is not None:
|
||||||
|
save_policy(pruned)
|
||||||
Reference in new issue
Block a user