Add --force option to zone sync
This commit is contained in:
1 parent
1ef39a9c89
commit
3d7d3c0748
2 files changed
+8
-3
No files matched your search
@@ -24,7 +24,7 @@ class Command(BaseCommand):
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
dest='force',
|
dest='force',
|
||||||
default=False,
|
default=False,
|
||||||
help='Write zone files even if serial is unchanged.'),
|
help='Write configuration even if serial is unchanged.'),
|
||||||
make_option('--restart',
|
make_option('--restart',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
dest='restart',
|
dest='restart',
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ from mdb.models import *
|
|||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
args = '[--debug]'
|
args = '[--force] [--debug]'
|
||||||
help = 'Generates the bind configuration'
|
help = 'Generates the bind configuration'
|
||||||
|
|
||||||
option_list = BaseCommand.option_list + (
|
option_list = BaseCommand.option_list + (
|
||||||
@@ -21,6 +21,11 @@ class Command(BaseCommand):
|
|||||||
dest='debug',
|
dest='debug',
|
||||||
default=False,
|
default=False,
|
||||||
help='Debug mode. Writes to /tmp and does not reload.'),
|
help='Debug mode. Writes to /tmp and does not reload.'),
|
||||||
|
make_option('--force',
|
||||||
|
action='store_true',
|
||||||
|
dest='force',
|
||||||
|
default=False,
|
||||||
|
help='Write zone files even if serial is unchanged.'),
|
||||||
)
|
)
|
||||||
|
|
||||||
bind_bin = "/etc/init.d/bind9"
|
bind_bin = "/etc/init.d/bind9"
|
||||||
@@ -49,7 +54,7 @@ class Command(BaseCommand):
|
|||||||
for zone in chain(Domain.objects.all(),
|
for zone in chain(Domain.objects.all(),
|
||||||
Ip4Subnet.objects.all(),
|
Ip4Subnet.objects.all(),
|
||||||
Ip6Subnet.objects.all()):
|
Ip6Subnet.objects.all()):
|
||||||
if zone.domain_serial == zone.domain_active_serial:
|
if zone.domain_serial == zone.domain_active_serial or force:
|
||||||
continue
|
continue
|
||||||
self.update_zone(zone)
|
self.update_zone(zone)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user