From 376baae583322ab5d14fd374ff08437e358a1102 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Sun, 6 Jul 2014 18:24:35 +0200 Subject: [PATCH] Take advantage of the YAML multiline notation --- .../common/tasks/network-configuration.yml | 29 +++++++++---------- bootstrapvz/common/tasks/network.py | 2 +- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/bootstrapvz/common/tasks/network-configuration.yml b/bootstrapvz/common/tasks/network-configuration.yml index c044069..12e5f03 100644 --- a/bootstrapvz/common/tasks/network-configuration.yml +++ b/bootstrapvz/common/tasks/network-configuration.yml @@ -1,17 +1,16 @@ --- # This is a mapping of Debian release codenames to NIC configurations -# Every item in an array is a line -squeeze: -- auto lo -- iface lo inet loopback -- auto eth0 -- iface eth0 inet dhcp -wheezy: -- auto eth0 -- iface eth0 inet dhcp -jessie: -- auto eth0 -- iface eth0 inet dhcp -sid: -- auto eth0 -- iface eth0 inet dhcp +squeeze: | + auto lo + iface lo inet loopback + auto eth0 + iface eth0 inet dhcp +wheezy: | + auto eth0 + iface eth0 inet dhcp +jessie: | + auto eth0 + iface eth0 inet dhcp +sid: | + auto eth0 + iface eth0 inet dhcp diff --git a/bootstrapvz/common/tasks/network.py b/bootstrapvz/common/tasks/network.py index 72da5c9..858b158 100644 --- a/bootstrapvz/common/tasks/network.py +++ b/bootstrapvz/common/tasks/network.py @@ -51,4 +51,4 @@ class ConfigureNetworkIF(Task): interfaces_path = os.path.join(info.root, 'etc/network/interfaces') with open(interfaces_path, 'a') as interfaces: - interfaces.write('\n'.join(if_config) + '\n') + interfaces.write(if_config + '\n')