diff options
author | Ryan Harper <ryan.harper@canonical.com> | 2018-09-05 14:17:16 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2018-09-05 14:17:16 +0000 |
commit | db50bc0d999e3a90136864a774f85e4e15b144e8 (patch) | |
tree | c0233ddee1fdec72c19500217ae001fa41d9a051 /cloudinit/distros/opensuse.py | |
parent | 3f6d0972d83c8bfd6a5e666d73cb84a8cfe9c8b6 (diff) | |
download | vyos-cloud-init-db50bc0d999e3a90136864a774f85e4e15b144e8.tar.gz vyos-cloud-init-db50bc0d999e3a90136864a774f85e4e15b144e8.zip |
sysconfig: refactor sysconfig to accept distro specific templates paths
Multiple distros use sysconfig format but have different content
and paths to certain files. Update distros to specify these
template paths in their renderer_configs dictionary.
Diffstat (limited to 'cloudinit/distros/opensuse.py')
-rw-r--r-- | cloudinit/distros/opensuse.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cloudinit/distros/opensuse.py b/cloudinit/distros/opensuse.py index 9f90e95e..1fe896aa 100644 --- a/cloudinit/distros/opensuse.py +++ b/cloudinit/distros/opensuse.py @@ -28,13 +28,23 @@ class Distro(distros.Distro): hostname_conf_fn = '/etc/HOSTNAME' init_cmd = ['service'] locale_conf_fn = '/etc/sysconfig/language' - network_conf_fn = '/etc/sysconfig/network' + network_conf_fn = '/etc/sysconfig/network/config' network_script_tpl = '/etc/sysconfig/network/ifcfg-%s' resolve_conf_fn = '/etc/resolv.conf' route_conf_tpl = '/etc/sysconfig/network/ifroute-%s' systemd_hostname_conf_fn = '/etc/hostname' systemd_locale_conf_fn = '/etc/locale.conf' tz_local_fn = '/etc/localtime' + renderer_configs = { + 'sysconfig': { + 'control': 'etc/sysconfig/network/config', + 'iface_templates': '%(base)s/network/ifcfg-%(name)s', + 'route_templates': { + 'ipv4': '%(base)s/network/ifroute-%(name)s', + 'ipv6': '%(base)s/network/ifroute-%(name)s', + } + } + } def __init__(self, name, cfg, paths): distros.Distro.__init__(self, name, cfg, paths) @@ -208,6 +218,9 @@ class Distro(distros.Distro): nameservers, searchservers) return dev_names + def _write_network_config(self, netconfig): + return self._supported_write_network_config(netconfig) + @property def preferred_ntp_clients(self): """The preferred ntp client is dependent on the version.""" |