summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/distros/debian.py14
-rw-r--r--cloudinit/sources/DataSourceNoCloud.py3
2 files changed, 5 insertions, 12 deletions
diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py
index 24545fd4..36a844f1 100644
--- a/cloudinit/distros/debian.py
+++ b/cloudinit/distros/debian.py
@@ -44,14 +44,6 @@ 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"
@@ -87,9 +79,9 @@ class Distro(distros.Distro):
return ['all']
def _write_network_config(self, netconfig):
- # TODO: THIS IS NOT TESTED
- render_network_config(netconfig)
- return ['all']
+ ns = net.parse_net_config_data(netconfig)
+ net.render_network_state(network_state=ns, target="/")
+ return []
def _bring_up_interfaces(self, device_names):
use_all = False
diff --git a/cloudinit/sources/DataSourceNoCloud.py b/cloudinit/sources/DataSourceNoCloud.py
index e00210e7..a3532463 100644
--- a/cloudinit/sources/DataSourceNoCloud.py
+++ b/cloudinit/sources/DataSourceNoCloud.py
@@ -195,7 +195,8 @@ class DataSourceNoCloud(sources.DataSource):
mydata['meta-data']['network-interfaces'])
elif mydata.get('network-config'):
LOG.debug("Updating network config from %s", self)
- self.distro.apply_network_config(mydata['network-config'])
+ self.distro.apply_network_config(mydata['network-config'],
+ bring_up=False)
if mydata['meta-data']['dsmode'] == self.dsmode:
self.seed = ",".join(found)