summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_write_files_deferred.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/config/cc_write_files_deferred.py')
-rw-r--r--cloudinit/config/cc_write_files_deferred.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/cloudinit/config/cc_write_files_deferred.py b/cloudinit/config/cc_write_files_deferred.py
index 4fc8659c..1294628c 100644
--- a/cloudinit/config/cc_write_files_deferred.py
+++ b/cloudinit/config/cc_write_files_deferred.py
@@ -4,10 +4,11 @@
"""Defer writing certain files"""
-from cloudinit.config.schema import validate_cloudconfig_schema
from cloudinit import util
-from cloudinit.config.cc_write_files import (
- schema as write_files_schema, write_files, DEFAULT_DEFER)
+from cloudinit.config.cc_write_files import DEFAULT_DEFER
+from cloudinit.config.cc_write_files import schema as write_files_schema
+from cloudinit.config.cc_write_files import write_files
+from cloudinit.config.schema import validate_cloudconfig_schema
# meta is not used in this module, but it remains as code documentation
#
@@ -36,15 +37,18 @@ __doc__ = None
def handle(name, cfg, _cloud, log, _args):
validate_cloudconfig_schema(cfg, schema)
- file_list = cfg.get('write_files', [])
+ file_list = cfg.get("write_files", [])
filtered_files = [
- f for f in file_list if util.get_cfg_option_bool(f,
- 'defer',
- DEFAULT_DEFER)
+ f
+ for f in file_list
+ if util.get_cfg_option_bool(f, "defer", DEFAULT_DEFER)
]
if not filtered_files:
- log.debug(("Skipping module named %s,"
- " no deferred file defined in configuration"), name)
+ log.debug(
+ "Skipping module named %s,"
+ " no deferred file defined in configuration",
+ name,
+ )
return
write_files(name, filtered_files)