[mod] write the whole file at once

This commit is contained in:
Laurent Peuch 2017-08-21 00:17:06 +02:00
parent 2e9f63efe2
commit e51f1eb11a

View file

@ -105,8 +105,7 @@ os.system('cp '+ conf_file +' '+ conf_file +'.back')
# Write Bind configuration file. # Write Bind configuration file.
with open(conf_file, 'w') as zone: with open(conf_file, 'w') as zone:
for line in lines: zone.write('\n'.join(lines) + '\n')
zone.write(line + '\n')
# Restore ownership # Restore ownership
os.system('chown -R bind:bind '+ zone_dir +' '+ conf_file) os.system('chown -R bind:bind '+ zone_dir +' '+ conf_file)