summaryrefslogtreecommitdiff
path: root/cloudinit/config
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/config')
-rw-r--r--cloudinit/config/cc_landscape.py8
-rw-r--r--cloudinit/config/cc_update_etc_hosts.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/cloudinit/config/cc_landscape.py b/cloudinit/config/cc_landscape.py
index d45c9203..99a958b0 100644
--- a/cloudinit/config/cc_landscape.py
+++ b/cloudinit/config/cc_landscape.py
@@ -61,10 +61,10 @@ def handle(name, cfg, cloud, log, _args):
ls_cloudcfg = cfg.get("landscape", {})
- if not isinstance(ls_cloudcfg, dict):
- raise Exception(("'landscape' key existed in config,"
- " but not a dictionary type,"
- " is a %s instead"), util.obj_name(ls_cloudcfg))
+ if not isinstance(ls_cloudcfg, (dict)):
+ raise RuntimeError(("'landscape' key existed in config,"
+ " but not a dictionary type,"
+ " is a %s instead"), util.obj_name(ls_cloudcfg))
merge_data = [
LSC_BUILTIN_CFG,
diff --git a/cloudinit/config/cc_update_etc_hosts.py b/cloudinit/config/cc_update_etc_hosts.py
index 6820ac4f..c148b12e 100644
--- a/cloudinit/config/cc_update_etc_hosts.py
+++ b/cloudinit/config/cc_update_etc_hosts.py
@@ -39,8 +39,8 @@ def handle(name, cfg, cloud, log, _args):
distro_n = cloud.distro.name
tpl_fn_name = cloud.get_template_filename("hosts.%s" % (distro_n))
if not tpl_fn_name:
- raise Exception(("No hosts template could be"
- " found for distro %s") % (distro_n))
+ raise RuntimeError(("No hosts template could be"
+ " found for distro %s") % (distro_n))
out_fn = cloud.paths.join(False, '/etc/hosts')
templater.render_to_file(tpl_fn_name, out_fn,