Take advantage of the YAML multiline notation

This commit is contained in:
Anders Ingemann 2014-07-06 18:24:35 +02:00
parent 03a0746299
commit 376baae583
2 changed files with 15 additions and 16 deletions

View file

@ -1,17 +1,16 @@
--- ---
# This is a mapping of Debian release codenames to NIC configurations # This is a mapping of Debian release codenames to NIC configurations
# Every item in an array is a line squeeze: |
squeeze: auto lo
- auto lo iface lo inet loopback
- iface lo inet loopback auto eth0
- auto eth0 iface eth0 inet dhcp
- iface eth0 inet dhcp wheezy: |
wheezy: auto eth0
- auto eth0 iface eth0 inet dhcp
- iface eth0 inet dhcp jessie: |
jessie: auto eth0
- auto eth0 iface eth0 inet dhcp
- iface eth0 inet dhcp sid: |
sid: auto eth0
- auto eth0 iface eth0 inet dhcp
- iface eth0 inet dhcp

View file

@ -51,4 +51,4 @@ class ConfigureNetworkIF(Task):
interfaces_path = os.path.join(info.root, 'etc/network/interfaces') interfaces_path = os.path.join(info.root, 'etc/network/interfaces')
with open(interfaces_path, 'a') as interfaces: with open(interfaces_path, 'a') as interfaces:
interfaces.write('\n'.join(if_config) + '\n') interfaces.write(if_config + '\n')