summaryrefslogtreecommitdiff
path: root/cloudinit/config
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/config')
-rw-r--r--cloudinit/config/cc_apt_configure.py5
-rw-r--r--cloudinit/config/cc_disk_setup.py8
-rw-r--r--cloudinit/config/cc_landscape.py8
-rw-r--r--cloudinit/config/cc_ntp.py10
-rw-r--r--cloudinit/config/cc_seed_random.py3
-rw-r--r--cloudinit/config/cc_snap_config.py7
6 files changed, 24 insertions, 17 deletions
diff --git a/cloudinit/config/cc_apt_configure.py b/cloudinit/config/cc_apt_configure.py
index 177cbcf7..5b9cbca0 100644
--- a/cloudinit/config/cc_apt_configure.py
+++ b/cloudinit/config/cc_apt_configure.py
@@ -275,8 +275,9 @@ def handle(name, ocfg, cloud, log, _):
cfg = ocfg.get('apt', {})
if not isinstance(cfg, dict):
- raise ValueError("Expected dictionary for 'apt' config, found %s",
- type(cfg))
+ raise ValueError(
+ "Expected dictionary for 'apt' config, found {config_type}".format(
+ config_type=type(cfg)))
apply_debconf_selections(cfg, target)
apply_apt(cfg, cloud, target)
diff --git a/cloudinit/config/cc_disk_setup.py b/cloudinit/config/cc_disk_setup.py
index c2b83aea..c3e8c484 100644
--- a/cloudinit/config/cc_disk_setup.py
+++ b/cloudinit/config/cc_disk_setup.py
@@ -788,7 +788,8 @@ def mkpart(device, definition):
# This prevents you from overwriting the device
LOG.debug("Checking if device %s is a valid device", device)
if not is_device_valid(device):
- raise Exception("Device %s is not a disk device!", device)
+ raise Exception(
+ 'Device {device} is not a disk device!'.format(device=device))
# Remove the partition table entries
if isinstance(layout, str) and layout.lower() == "remove":
@@ -945,8 +946,9 @@ def mkfs(fs_cfg):
# Check that we can create the FS
if not (fs_type or fs_cmd):
- raise Exception("No way to create filesystem '%s'. fs_type or fs_cmd "
- "must be set.", label)
+ raise Exception(
+ "No way to create filesystem '{label}'. fs_type or fs_cmd "
+ "must be set.".format(label=label))
# Create the commands
shell = False
diff --git a/cloudinit/config/cc_landscape.py b/cloudinit/config/cc_landscape.py
index 8f9f1abd..eaf1e940 100644
--- a/cloudinit/config/cc_landscape.py
+++ b/cloudinit/config/cc_landscape.py
@@ -94,10 +94,10 @@ def handle(_name, cfg, cloud, log, _args):
ls_cloudcfg = cfg.get("landscape", {})
if not isinstance(ls_cloudcfg, (dict)):
- raise RuntimeError(("'landscape' key existed in config,"
- " but not a dictionary type,"
- " is a %s instead"),
- type_utils.obj_name(ls_cloudcfg))
+ raise RuntimeError(
+ "'landscape' key existed in config, but not a dictionary type,"
+ " is a {_type} instead".format(
+ _type=type_utils.obj_name(ls_cloudcfg)))
if not ls_cloudcfg:
return
diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py
index f50bcb35..cbd0237d 100644
--- a/cloudinit/config/cc_ntp.py
+++ b/cloudinit/config/cc_ntp.py
@@ -106,9 +106,9 @@ def handle(name, cfg, cloud, log, _args):
# TODO drop this when validate_cloudconfig_schema is strict=True
if not isinstance(ntp_cfg, (dict)):
- raise RuntimeError(("'ntp' key existed in config,"
- " but not a dictionary type,"
- " is a %s %instead"), type_utils.obj_name(ntp_cfg))
+ raise RuntimeError(
+ "'ntp' key existed in config, but not a dictionary type,"
+ " is a {_type} instead".format(_type=type_utils.obj_name(ntp_cfg)))
validate_cloudconfig_schema(cfg, schema)
if ntp_installable():
@@ -206,8 +206,8 @@ def write_ntp_config_template(cfg, cloud, path, template=None):
if not template_fn:
template_fn = cloud.get_template_filename('ntp.conf')
if not template_fn:
- raise RuntimeError(("No template found, "
- "not rendering %s"), path)
+ raise RuntimeError(
+ 'No template found, not rendering {path}'.format(path=path))
templater.render_to_file(template_fn, path, params)
diff --git a/cloudinit/config/cc_seed_random.py b/cloudinit/config/cc_seed_random.py
index e76b9c09..65f6e777 100644
--- a/cloudinit/config/cc_seed_random.py
+++ b/cloudinit/config/cc_seed_random.py
@@ -95,7 +95,8 @@ def handle_random_seed_command(command, required, env=None):
cmd = command[0]
if not util.which(cmd):
if required:
- raise ValueError("command '%s' not found but required=true", cmd)
+ raise ValueError(
+ "command '{cmd}' not found but required=true".format(cmd=cmd))
else:
LOG.debug("command '%s' not found for seed_command", cmd)
return
diff --git a/cloudinit/config/cc_snap_config.py b/cloudinit/config/cc_snap_config.py
index fe0cc73e..e82c0811 100644
--- a/cloudinit/config/cc_snap_config.py
+++ b/cloudinit/config/cc_snap_config.py
@@ -87,7 +87,9 @@ def add_assertions(assertions=None):
assertions = []
if not isinstance(assertions, list):
- raise ValueError('assertion parameter was not a list: %s', assertions)
+ raise ValueError(
+ 'assertion parameter was not a list: {assertions}'.format(
+ assertions=assertions))
snap_cmd = [SNAPPY_CMD, 'ack']
combined = "\n".join(assertions)
@@ -115,7 +117,8 @@ def add_snap_user(cfg=None):
cfg = {}
if not isinstance(cfg, dict):
- raise ValueError('configuration parameter was not a dict: %s', cfg)
+ raise ValueError(
+ 'configuration parameter was not a dict: {cfg}'.format(cfg=cfg))
snapuser = cfg.get('email', None)
if not snapuser: