From 04047438d7bbca0367f1b0722c0959fd92166e3e Mon Sep 17 00:00:00 2001 From: Shreenidhi Shedi <53473811+sshedi@users.noreply.github.com> Date: Fri, 13 Aug 2021 09:08:53 +0530 Subject: cc_resolv_conf: fix typos (#969) Add tests for cc_resolv_conf handler --- cloudinit/config/cc_resolv_conf.py | 7 ++++--- cloudinit/net/networkd.py | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'cloudinit') diff --git a/cloudinit/config/cc_resolv_conf.py b/cloudinit/config/cc_resolv_conf.py index c51967e2..648935e4 100644 --- a/cloudinit/config/cc_resolv_conf.py +++ b/cloudinit/config/cc_resolv_conf.py @@ -108,18 +108,19 @@ def handle(name, cfg, cloud, log, _args): if "resolv_conf" not in cfg: log.warning("manage_resolv_conf True but no parameters provided!") + return try: template_fn = cloud.get_template_filename( - RESOLVE_CONFIG_TEMPLATE_MAP[cloud.distro.resolv_conf_fn]) + RESOLVE_CONFIG_TEMPLATE_MAP[cloud.distro.resolve_conf_fn]) except KeyError: - log.warning("No template found, not rendering /etc/resolv.conf") + log.warning("No template found, not rendering resolve configs") return generate_resolv_conf( template_fn=template_fn, params=cfg["resolv_conf"], - target_fname=cloud.disro.resolve_conf_fn + target_fname=cloud.distro.resolve_conf_fn ) return diff --git a/cloudinit/net/networkd.py b/cloudinit/net/networkd.py index 63e3a07f..a311572f 100644 --- a/cloudinit/net/networkd.py +++ b/cloudinit/net/networkd.py @@ -72,8 +72,8 @@ class Renderer(renderer.Renderer): def __init__(self, config=None): if not config: config = {} - self.resolved_conf = config.get('resolved_conf_fn', - '/etc/systemd/resolved.conf') + self.resolve_conf_fn = config.get('resolve_conf_fn', + '/etc/systemd/resolved.conf') self.network_conf_dir = config.get('network_conf_dir', '/etc/systemd/network/') -- cgit v1.2.3