diff options
author | Wesley Wiedenmeier <wesley.wiedenmeier@gmail.com> | 2016-03-22 02:02:22 -0500 |
---|---|---|
committer | Wesley Wiedenmeier <wesley.wiedenmeier@gmail.com> | 2016-03-22 02:02:22 -0500 |
commit | 7eccb0f0f3693662b3f288e7a74cb5bd6d7814ea (patch) | |
tree | 86c80f098f5b73c93f00103e4877af64e2be1add /cloudinit/net | |
parent | e66bcc8b2ea7648c15476cdd43d3753ee6c27ff1 (diff) | |
download | vyos-cloud-init-7eccb0f0f3693662b3f288e7a74cb5bd6d7814ea.tar.gz vyos-cloud-init-7eccb0f0f3693662b3f288e7a74cb5bd6d7814ea.zip |
In generate_fallback_config return full netconfig dict with 'config' and
'version' keys
Diffstat (limited to 'cloudinit/net')
-rw-r--r-- | cloudinit/net/__init__.py | 11 |
1 files changed, 7 insertions, 4 deletions
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): |