Commit b39958fb authored by godog's avatar godog

main: exit 0 only when zones have changed

parent f999bc96
Pipeline #2004 failed with stage
in 23 seconds
...@@ -74,7 +74,12 @@ def main(): ...@@ -74,7 +74,12 @@ def main():
dry_run=opts.dry_run, dry_run=opts.dry_run,
update_policies=opts.update_policies) update_policies=opts.update_policies)
changed, removed = zw.write(zp.render(), postproc=pproc) changed, removed = zw.write(zp.render(), postproc=pproc)
# Success is defined as having changed bind config
if not opts.dry_run and (len(changed) + len(removed) > 0):
sys.exit(0) sys.exit(0)
if __name__ == '__main__': if __name__ == '__main__':
  • Questo pero' e' un casino (come sempre in questi casi) perche' l'exit status 1 significa che c'e' stato un errore e il risultato e' indefinito. Servono 3 stati separati, cosa che purtroppo non funziona bene con gli script shell.

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment