summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/distros/net_util.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/cloudinit/distros/net_util.py b/cloudinit/distros/net_util.py
index f56f6ccd..f8c34846 100644
--- a/cloudinit/distros/net_util.py
+++ b/cloudinit/distros/net_util.py
@@ -169,15 +169,16 @@ def translate_network(settings):
real_ifaces[dev_name] = iface_info
# Check for those that should be started on boot via 'auto'
for (cmd, args) in entries:
+ args = args.split(None)
+ if not args:
+ continue
+ dev_name = args[0].strip().lower()
if cmd == 'auto':
# Seems like auto can be like 'auto eth0 eth0:1' so just get the
# first part out as the device name
- args = args.split(None)
- if not args:
- continue
- dev_name = args[0].strip().lower()
if dev_name in real_ifaces:
real_ifaces[dev_name]['auto'] = True
if cmd == 'iface' and 'inet6' in args:
- real_ifaces[dev_name]['inet6'] = True
+ real_ifaces[dev_name]['inet6'] = True
return real_ifaces
+