summaryrefslogtreecommitdiff
path: root/cloudinit/net/sysconfig.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-03-15 12:06:40 -0400
committerScott Moser <smoser@brickies.net>2017-03-17 14:28:28 -0400
commit1a2ca7530518d819cbab7287b12f942743427e38 (patch)
treed262d253e57c119cb4b87d919c8f23b8747f79a2 /cloudinit/net/sysconfig.py
parent3ec116a1bb3646c2ff932bed24b4bf087b51cb8c (diff)
downloadvyos-cloud-init-1a2ca7530518d819cbab7287b12f942743427e38.tar.gz
vyos-cloud-init-1a2ca7530518d819cbab7287b12f942743427e38.zip
support 'loopback' as a device type.
As reported in bug 1671927, sysconfig had an issue with rendering a loopback device. The problem was that some as yet unknown issue was causing the openstack config drive to parse the provided ENI file rather than reading the network_data.json. Parsing an ENI file would add a a 'lo' device of type 'physical', and sysconfig was failing to render that. The change here is: a.) add a 'loopback' type rather than 'physical' for network config. {'name': 'lo', 'type': 'loopback', 'subnets': ['type': 'loopback']} b.) support skipping that type in the eni and sysconfig renderers. c.) make network_state just piggy back on 'physical' renderer for loopback (this was what was happening before). Tests are added for eni and sysconfig renderer.
Diffstat (limited to 'cloudinit/net/sysconfig.py')
-rw-r--r--cloudinit/net/sysconfig.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
index 06de660f..7f52db4a 100644
--- a/cloudinit/net/sysconfig.py
+++ b/cloudinit/net/sysconfig.py
@@ -368,6 +368,8 @@ class Renderer(renderer.Renderer):
'''Given state, return /etc/sysconfig files + contents'''
iface_contents = {}
for iface in network_state.iter_interfaces():
+ if iface['type'] == "loopback":
+ continue
iface_name = iface['name']
iface_cfg = NetInterface(iface_name, base_sysconf_dir)
cls._render_iface_shared(iface, iface_cfg)