summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2016-05-09 16:36:04 -0700
committerJoshua Harlow <harlowja@gmail.com>2016-05-09 16:36:04 -0700
commita800da2371b85b2ece1a30de00f988035819c958 (patch)
tree4e21068cca1665758027bc413e093e8e125a388b
parent247fbc9ce9ac6f47d670a19f073bda0a1f746669 (diff)
downloadvyos-cloud-init-a800da2371b85b2ece1a30de00f988035819c958.tar.gz
vyos-cloud-init-a800da2371b85b2ece1a30de00f988035819c958.zip
Use the new renderer in the debian and stages files
-rw-r--r--cloudinit/distros/debian.py10
-rw-r--r--cloudinit/net/distros/debian.py2
-rw-r--r--cloudinit/stages.py4
3 files changed, 9 insertions, 7 deletions
diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py
index 75ab340f..e8fc1df4 100644
--- a/cloudinit/distros/debian.py
+++ b/cloudinit/distros/debian.py
@@ -27,6 +27,7 @@ from cloudinit import helpers
from cloudinit import log as logging
from cloudinit import util
from cloudinit import net
+from cloudinit.net.distros import debian
from cloudinit.distros.parsers.hostname import HostnameConf
@@ -56,6 +57,7 @@ class Distro(distros.Distro):
# should only happen say once per instance...)
self._runner = helpers.Runners(paths)
self.osfamily = 'debian'
+ self.renderer = debian.Renderer()
def apply_locale(self, locale, out_fn=None):
if not out_fn:
@@ -80,10 +82,10 @@ class Distro(distros.Distro):
def _write_network_config(self, netconfig):
ns = net.parse_net_config_data(netconfig)
- net.render_network_state(target="/", network_state=ns,
- eni=self.network_conf_fn,
- links_prefix=self.links_prefix,
- netrules=None)
+ self.renderer.render_network_state(
+ target="/", network_state=ns,
+ eni=self.network_conf_fn, links_prefix=self.links_prefix,
+ netrules=None)
_maybe_remove_legacy_eth0()
return []
diff --git a/cloudinit/net/distros/debian.py b/cloudinit/net/distros/debian.py
index 3ab0483e..4bf34fd7 100644
--- a/cloudinit/net/distros/debian.py
+++ b/cloudinit/net/distros/debian.py
@@ -258,7 +258,7 @@ class Renderer(object):
return content
- def render_routes(self, route, indent=""):
+ def render_route(self, route, indent=""):
""" When rendering routes for an iface, in some cases applying a route
may result in the route command returning non-zero which produces
some confusing output for users manually using ifup/ifdown[1]. To
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index ffb15165..e6bd34fe 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -43,7 +43,7 @@ from cloudinit import distros
from cloudinit import helpers
from cloudinit import importer
from cloudinit import log as logging
-from cloudinit import net
+from cloudinit.net import klibc
from cloudinit import sources
from cloudinit import type_utils
from cloudinit import util
@@ -579,7 +579,7 @@ class Init(object):
if os.path.exists(disable_file):
return (None, disable_file)
- cmdline_cfg = ('cmdline', net.read_kernel_cmdline_config())
+ cmdline_cfg = ('cmdline', klibc.read_kernel_cmdline_config())
dscfg = ('ds', None)
if self.datasource and hasattr(self.datasource, 'network_config'):
dscfg = ('ds', self.datasource.network_config)