summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/net/eni.py16
-rw-r--r--cloudinit/net/network_state.py4
-rw-r--r--cloudinit/net/sysconfig.py2
3 files changed, 16 insertions, 6 deletions
diff --git a/cloudinit/net/eni.py b/cloudinit/net/eni.py
index 5b249f1f..69ecbb5d 100644
--- a/cloudinit/net/eni.py
+++ b/cloudinit/net/eni.py
@@ -273,8 +273,11 @@ def _ifaces_to_net_config_data(ifaces):
# devname is 'eth0' for name='eth0:1'
devname = name.partition(":")[0]
if devname not in devs:
- devs[devname] = {'type': 'physical', 'name': devname,
- 'subnets': []}
+ if devname == "lo":
+ dtype = "loopback"
+ else:
+ dtype = "physical"
+ devs[devname] = {'type': dtype, 'name': devname, 'subnets': []}
# this isnt strictly correct, but some might specify
# hwaddress on a nic for matching / declaring name.
if 'hwaddress' in data:
@@ -423,10 +426,11 @@ class Renderer(renderer.Renderer):
bonding
'''
order = {
- 'physical': 0,
- 'bond': 1,
- 'bridge': 2,
- 'vlan': 3,
+ 'loopback': 0,
+ 'physical': 1,
+ 'bond': 2,
+ 'bridge': 3,
+ 'vlan': 4,
}
sections = []
diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py
index 11ef585b..90b2835a 100644
--- a/cloudinit/net/network_state.py
+++ b/cloudinit/net/network_state.py
@@ -212,6 +212,10 @@ class NetworkStateInterpreter(object):
LOG.debug(self.dump_network_state())
@ensure_command_keys(['name'])
+ def handle_loopback(self, command):
+ return self.handle_physical(command)
+
+ @ensure_command_keys(['name'])
def handle_physical(self, command):
'''
command = {
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)