from .pdns_zone import PdnsApiZone
from .pdns_record import compare_rrsets
-__version__ = '0.2.7'
+__version__ = '0.2.8'
LOG = logging.getLogger(__name__)
address_hostmaster_local = 'hostmaster.pixelpark.com.'
address_hostmaster_public = 'hostmaster.pixelpark.net.'
+ default_pause = 3
+
# -------------------------------------------------------------------------
def __init__(self, appname=None, version=__version__):
self.zones = []
self.zone_names = []
self.oneshot = False
+ self.pause = self.default_pause
description = textwrap.dedent('''\
Substituting NS records in all zones by the new ones.
help="Stop execution after first successful migration."
)
+ self.arg_parser.add_argument(
+ '--pause', dest='pause', type=int,
+ default=self.default_pause, metavar='SECS',
+ help=(
+ "Pause in seconds between mangling the particular zones. "
+ "(Default: %(default)r)."),
+ )
+
self.arg_parser.add_argument(
'zones', metavar='ZONE', nargs='*',
help=(
if self.args.oneshot:
self.oneshot = True
+ if self.args.pause and self.args.pause > 0:
+ self.pause = self.args.pause
+
for zone in self.args.zones:
zone_idna = zone
if 'xn--' not in zone:
if idx:
print('')
print('')
- print('Sleeping a little bit ...')
+ print('Sleeping {} seconds...'.format(self.pause))
print('')
- time.sleep(3)
+ time.sleep(self.pause)
migrated = self.migrate_zone(zone_name)
if migrated:
idx += 1