From 0cfda1bdb594ef9d7179c3280fab71c6f684782f Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Wed, 15 Jan 2014 21:13:36 +0100 Subject: [PATCH] Simpler json network config by auto inserting \n --- common/tasks/network-configuration.json | 16 ++++++++-------- common/tasks/network.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/tasks/network-configuration.json b/common/tasks/network-configuration.json index 854ed22..0a12c4c 100644 --- a/common/tasks/network-configuration.json +++ b/common/tasks/network-configuration.json @@ -1,13 +1,13 @@ { "squeeze": [ - "auto lo\n", - "iface lo inet loopback\n", - "auto eth0\n", - "iface eth0 inet dhcp\n" ], + "auto lo", + "iface lo inet loopback", + "auto eth0", + "iface eth0 inet dhcp" ], "wheezy": [ - "auto eth0\n", - "iface eth0 inet dhcp\n" ], + "auto eth0", + "iface eth0 inet dhcp" ], "unstable": [ - "auto eth0\n", - "iface eth0 inet dhcp\n" ] + "auto eth0", + "iface eth0 inet dhcp" ] } diff --git a/common/tasks/network.py b/common/tasks/network.py index 6be1de7..7392658 100644 --- a/common/tasks/network.py +++ b/common/tasks/network.py @@ -35,4 +35,4 @@ class ConfigureNetworkIF(Task): import json if_config = json.loads(stream.read()) 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'])))