From 7eccb0f0f3693662b3f288e7a74cb5bd6d7814ea Mon Sep 17 00:00:00 2001 From: Wesley Wiedenmeier Date: Tue, 22 Mar 2016 02:02:22 -0500 Subject: In generate_fallback_config return full netconfig dict with 'config' and 'version' keys --- cloudinit/net/__init__.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'cloudinit/net') diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py index 48b82a2c..389c2afb 100644 --- a/cloudinit/net/__init__.py +++ b/cloudinit/net/__init__.py @@ -287,8 +287,11 @@ def generate_fallback_config(): """Determine which attached net dev is most likely to have a connection and generate network state to run dhcp on that interface""" # by default use eth0 as primary interface - ns = {'interfaces': {}, 'dns': {'search': [], 'nameservers': []}, - 'routes': []} + nconf = {'config': {'interfaces': {}, + 'dns': {'search': [], 'nameservers': []}, 'routes': [] + }, + 'version': 1 + } # get list of interfaces that could have connections invalid_interfaces = set(['lo']) @@ -351,13 +354,13 @@ def generate_fallback_config(): target_name = name # generate net config for interface - ns['interfaces'][target_name] = { + nconf['config']['interfaces'][target_name] = { 'mac_address': mac, 'name': target_name, 'type': 'physical', 'mode': 'manual', 'inet': 'inet', 'subnets': [{'type': 'dhcp4'}, {'type': 'dhcp6'}] } - return ns + return nconf def render_persistent_net(network_state): -- cgit v1.2.3