summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWesley Wiedenmeier <wesley.wiedenmeier@gmail.com>2016-03-18 02:40:13 -0500
committerWesley Wiedenmeier <wesley.wiedenmeier@gmail.com>2016-03-18 02:40:13 -0500
commitb123a912448b74a1d51a50baed8d3d7edd4875d7 (patch)
tree12eeb4d63aacdd8bce64a25eca2ae7aca7fa1c2b
parentc03915a454cfa947c1d905ba5b55a5207ad85cda (diff)
downloadvyos-cloud-init-b123a912448b74a1d51a50baed8d3d7edd4875d7.tar.gz
vyos-cloud-init-b123a912448b74a1d51a50baed8d3d7edd4875d7.zip
If proto not specified, determine it using logic from:
lp:cloud-initramfs-tools/dyn-netconf/scripts/init-bottom/cloud-initramfs-dyn-netconf
-rw-r--r--cloudinit/net/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py
index cce0773f..2bfaf149 100644
--- a/cloudinit/net/__init__.py
+++ b/cloudinit/net/__init__.py
@@ -289,6 +289,15 @@ def load_klibc_net_cfg(data_mapping):
'subnets': []
}
+ # ipconfig on precise does not write PROTO
+ # (lp:cloud-initramfs-tools/dyn-netconf/scripts/init-bottom/
+ # cloud-initramfs-dyn-netconf)
+ if not data_mapping.get('PROTO'):
+ if data_mapping.get('filename'):
+ data_mapping['PROTO'] = 'dhcp'
+ else:
+ data_mapping['PROTO'] = 'static'
+
if data_mapping.get('PROTO') == 'dhcp':
if data_mapping.get('IPV4ADDR'):
entry_ns['subnets'].append({'type': 'dhcp4'})