equal
deleted
inserted
replaced
22 parser.add_option('--root-zone', action='store_const', dest='zone_origin', const='.', |
22 parser.add_option('--root-zone', action='store_const', dest='zone_origin', const='.', |
23 help="Generate root zone") |
23 help="Generate root zone") |
24 |
24 |
25 parser.add_option('--add-origin', action='store_true', |
25 parser.add_option('--add-origin', action='store_true', |
26 help="Include $ORIGIN directive in zone") |
26 help="Include $ORIGIN directive in zone") |
|
27 |
|
28 parser.add_option('--check-conflicts', action='store_true', |
|
29 help="Check for dupliate forward records, e.g. multiple A records for the same name") |
27 |
30 |
28 # input |
31 # input |
29 options, args = pvl.args.parse(parser, argv) |
32 options, args = pvl.args.parse(parser, argv) |
30 |
33 |
31 if options.zone_origin: |
34 if options.zone_origin: |
50 hosts = pvl.hosts.apply(options, args) |
53 hosts = pvl.hosts.apply(options, args) |
51 |
54 |
52 # process |
55 # process |
53 try: |
56 try: |
54 for rr in pvl.hosts.zone.apply_hosts_forward(hosts, origin, |
57 for rr in pvl.hosts.zone.apply_hosts_forward(hosts, origin, |
55 add_origin = options.add_origin, |
58 add_origin = options.add_origin, |
|
59 check_conflicts = options.check_conflicts, |
56 ): |
60 ): |
57 print unicode(rr) |
61 print unicode(rr) |
58 except pvl.hosts.HostError as error: |
62 except pvl.hosts.HostError as error: |
59 log.error("%s", error) |
63 log.error("%s", error) |
60 return 3 |
64 return 3 |