From efd22ec256568b655c1dea1c61028b49b7fe04ab Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 11 Mar 2016 15:46:50 -0500 Subject: fix use of network state --- cloudinit/distros/debian.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py index 89d8d28e..24545fd4 100644 --- a/cloudinit/distros/debian.py +++ b/cloudinit/distros/debian.py @@ -44,6 +44,14 @@ APT_GET_WRAPPER = { } +def render_network_config(config, target="/"): + version = config['version'] + config = config['config'] + ns = network_state.NetworkState(version=version, config=config) + ns.parse_config() + net.render_network_state(target, ns.network_state) + + class Distro(distros.Distro): hostname_conf_fn = "/etc/hostname" locale_conf_fn = "/etc/default/locale" @@ -80,10 +88,7 @@ class Distro(distros.Distro): def _write_network_config(self, netconfig): # TODO: THIS IS NOT TESTED - state = network_state.NetworkState() - state.load(netconfig) - state.parse_config() - net.render_network_state("/", state) + render_network_config(netconfig) return ['all'] def _bring_up_interfaces(self, device_names): -- cgit v1.2.3