Simpler json network config by auto inserting \n

This commit is contained in:
Anders Ingemann 2014-01-15 21:13:36 +01:00
parent 319c6e655a
commit 0cfda1bdb5
2 changed files with 9 additions and 9 deletions

View file

@ -1,13 +1,13 @@
{ {
"squeeze": [ "squeeze": [
"auto lo\n", "auto lo",
"iface lo inet loopback\n", "iface lo inet loopback",
"auto eth0\n", "auto eth0",
"iface eth0 inet dhcp\n" ], "iface eth0 inet dhcp" ],
"wheezy": [ "wheezy": [
"auto eth0\n", "auto eth0",
"iface eth0 inet dhcp\n" ], "iface eth0 inet dhcp" ],
"unstable": [ "unstable": [
"auto eth0\n", "auto eth0",
"iface eth0 inet dhcp\n" ] "iface eth0 inet dhcp" ]
} }

View file

@ -35,4 +35,4 @@ class ConfigureNetworkIF(Task):
import json import json
if_config = json.loads(stream.read()) if_config = json.loads(stream.read())
with open(interfaces_path, 'a') as interfaces: with open(interfaces_path, 'a') as interfaces:
interfaces.write(''.join(if_config.get(info.manifest.system['release']))) interfaces.write('\n'.join(if_config.get(info.manifest.system['release'])))