mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
* spelling: ancillary * spelling: antarctica * spelling: australia * spelling: authentication * spelling: continental * spelling: constructor * spelling: conversion * spelling: creation * spelling: doesn't * spelling: easily * spelling: efficiently * spelling: equivalent * spelling: essentially * spelling: everything * spelling: exactly * spelling: be * spelling: expensive * spelling: supports * spelling: healthcheck * spelling: immediately * spelling: ignored * spelling: invocation * spelling: itself * spelling: leftovers * spelling: missing * spelling: natural * spelling: nonexistent * spelling: peculiarities * spelling: pointing This change hit a line length limitation, so I'm wrapping it and adding a period which appears to match local style... * spelling: quicker * spelling: response * spelling: requested * spelling: redirect * spelling: traffic * spelling: unknown * spelling: uploaded * spelling: useful * spelling: separately * spelling: zone
44 lines
1.5 KiB
Python
Executable File
44 lines
1.5 KiB
Python
Executable File
#!/usr/bin/env python
|
|
'''
|
|
Octo-DNS Multiplexer
|
|
'''
|
|
|
|
from __future__ import absolute_import, division, print_function, \
|
|
unicode_literals
|
|
|
|
from octodns.cmds.args import ArgumentParser
|
|
from octodns.manager import Manager
|
|
|
|
|
|
def main():
|
|
parser = ArgumentParser(description=__doc__.split('\n')[1])
|
|
|
|
parser.add_argument('--config-file', required=True,
|
|
help='The Manager configuration file to use')
|
|
parser.add_argument('--doit', action='store_true', default=False,
|
|
help='Whether to take action or just show what would '
|
|
'change')
|
|
parser.add_argument('--force', action='store_true', default=False,
|
|
help='Acknowledge that significant changes are being '
|
|
'made and do them')
|
|
|
|
parser.add_argument('zone', nargs='*', default=[],
|
|
help='Limit sync to the specified zone(s)')
|
|
|
|
# --sources isn't an option here b/c filtering sources out would be super
|
|
# dangerous since you could easily end up with an empty zone and delete
|
|
# everything, or even just part of things when there are multiple sources
|
|
|
|
parser.add_argument('--target', default=[], action='append',
|
|
help='Limit sync to the specified target(s)')
|
|
|
|
args = parser.parse_args()
|
|
|
|
manager = Manager(args.config_file)
|
|
manager.sync(eligible_zones=args.zone, eligible_targets=args.target,
|
|
dry_run=not args.doit, force=args.force)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|