add support for multiple addresses in zone.list
This commit is contained in:
parent
95a20f78e5
commit
bdcf586a6c
@ -103,7 +103,8 @@ def read_zone_list_from_file(zone_filename):
|
|||||||
config.read(zone_filename)
|
config.read(zone_filename)
|
||||||
for host in config:
|
for host in config:
|
||||||
for p in config[host]:
|
for p in config[host]:
|
||||||
zone_list.append([host, p.upper(), config[host][p]])
|
for target in config[host][p].split('\n'):
|
||||||
|
zone_list.append([host, p.upper(), target])
|
||||||
return zone_list
|
return zone_list
|
||||||
|
|
||||||
|
|
||||||
@ -124,6 +125,9 @@ def write_zone_list_to_file(zone_filename, zone_list):
|
|||||||
for host,typefield,target in zone_list:
|
for host,typefield,target in zone_list:
|
||||||
if not host in config:
|
if not host in config:
|
||||||
config[host] = {}
|
config[host] = {}
|
||||||
|
if typefield in config[host]:
|
||||||
|
config[host][typefield] += '\n'+target
|
||||||
|
else:
|
||||||
config[host][typefield] = target
|
config[host][typefield] = target
|
||||||
with open(zone_filename, 'w') as configfile:
|
with open(zone_filename, 'w') as configfile:
|
||||||
config.write(configfile)
|
config.write(configfile)
|
||||||
|
Loading…
Reference in New Issue
Block a user