summaryrefslogtreecommitdiff
path: root/cloudinit/distros/rhel.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-03-15 14:33:45 -0400
committerScott Moser <smoser@brickies.net>2017-03-17 21:31:56 -0400
commit5beecdf88b630a397b3722ddb299e9a37ff02737 (patch)
tree620b47c50cd392789bcd8afd3dc355bcbbf751bc /cloudinit/distros/rhel.py
parent58cc8f7521725d4f007ce90001a28326bc240231 (diff)
downloadvyos-cloud-init-5beecdf88b630a397b3722ddb299e9a37ff02737.tar.gz
vyos-cloud-init-5beecdf88b630a397b3722ddb299e9a37ff02737.zip
net: add renderers for automatically selecting the renderer.
Previously, the distro had hard coded which network renderer it would use. This adds support for just picking the right renderer based on what is available. Now, that can be set via a priority in system_info, but should generally work. That config looks like: system_info: network: renderers: ["eni", "sysconfig"] When no renderers are found, a specific RendererNotFoundError is raised. stages.py is modified to catch that and log it at error level. This path should not really be exercised, but could occur if for example an Ubuntu system did not have ifupdown, or a rhel system did not have sysconfig. In such a system previously we would have quietly rendered ENI configuration but that would have been ignored. This is one step better in that we at least log the error.
Diffstat (limited to 'cloudinit/distros/rhel.py')
-rw-r--r--cloudinit/distros/rhel.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/cloudinit/distros/rhel.py b/cloudinit/distros/rhel.py
index 7498c63a..372c7d0f 100644
--- a/cloudinit/distros/rhel.py
+++ b/cloudinit/distros/rhel.py
@@ -11,8 +11,6 @@
from cloudinit import distros
from cloudinit import helpers
from cloudinit import log as logging
-from cloudinit.net.network_state import parse_net_config_data
-from cloudinit.net import sysconfig
from cloudinit import util
from cloudinit.distros import net_util
@@ -49,16 +47,13 @@ class Distro(distros.Distro):
# should only happen say once per instance...)
self._runner = helpers.Runners(paths)
self.osfamily = 'redhat'
- self._net_renderer = sysconfig.Renderer()
cfg['ssh_svcname'] = 'sshd'
def install_packages(self, pkglist):
self.package_command('install', pkgs=pkglist)
def _write_network_config(self, netconfig):
- ns = parse_net_config_data(netconfig)
- self._net_renderer.render_network_state("/", ns)
- return []
+ return self._supported_write_network_config(netconfig)
def _write_network(self, settings):
# TODO(harlowja) fix this... since this is the ubuntu format