summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_write_files.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/config/cc_write_files.py')
-rw-r--r--cloudinit/config/cc_write_files.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/cloudinit/config/cc_write_files.py b/cloudinit/config/cc_write_files.py
index 061b9810..1bfa4c25 100644
--- a/cloudinit/config/cc_write_files.py
+++ b/cloudinit/config/cc_write_files.py
@@ -38,23 +38,23 @@ def handle(name, cfg, _cloud, log, _args):
write_files(name, files, log)
-def canonicalize_extraction(compression_type, log):
- if not compression_type:
- compression_type = ''
- compression_type = compression_type.lower().strip()
- if compression_type in ['gz', 'gzip']:
+def canonicalize_extraction(encoding_type, log):
+ if not encoding_type:
+ encoding_type = ''
+ encoding_type = encoding_type.lower().strip()
+ if encoding_type in ['gz', 'gzip']:
return ['application/x-gzip']
- if compression_type in ['gz+base64', 'gzip+base64', 'gz+b64', 'gzip+b64']:
+ if encoding_type in ['gz+base64', 'gzip+base64', 'gz+b64', 'gzip+b64']:
return ['application/base64', 'application/x-gzip']
# Yaml already encodes binary data as base64 if it is given to the
# yaml file as binary, so those will be automatically decoded for you.
# But the above b64 is just for people that are more 'comfortable'
# specifing it manually (which might be a possiblity)
- if compression_type in ['b64', 'base64']:
+ if encoding_type in ['b64', 'base64']:
return ['application/base64']
- if compression_type:
- log.warn("Unknown compression type %s, assuming %s",
- compression_type, UNKNOWN_ENC)
+ if encoding_type:
+ log.warn("Unknown encoding type %s, assuming %s",
+ encoding_type, UNKNOWN_ENC)
return [UNKNOWN_ENC]
@@ -69,7 +69,7 @@ def write_files(name, files, log):
i + 1, name)
continue
path = os.path.abspath(path)
- extractions = canonicalize_extraction(f_info.get('compression'), log)
+ extractions = canonicalize_extraction(f_info.get('encoding'), log)
contents = extract_contents(f_info.get('content', ''), extractions)
(u, g) = util.extract_usergroup(f_info.get('owner', DEFAULT_OWNER))
perms = decode_perms(f_info.get('permissions'), DEFAULT_PERMS, log)