From b123a912448b74a1d51a50baed8d3d7edd4875d7 Mon Sep 17 00:00:00 2001 From: Wesley Wiedenmeier Date: Fri, 18 Mar 2016 02:40:13 -0500 Subject: If proto not specified, determine it using logic from: lp:cloud-initramfs-tools/dyn-netconf/scripts/init-bottom/cloud-initramfs-dyn-netconf --- cloudinit/net/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cloudinit/net/__init__.py') 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'}) -- cgit v1.2.3