diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-03-27 10:03:27 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-03-27 10:03:27 -0400 |
commit | 2ecefdf51cd93b593bea450b4d751021da91e748 (patch) | |
tree | b9e7e851aa0daa1d7106d66e0f1642e04b4f46db /cloudinit/sources | |
parent | 9486c1a1abacb9829e5ab172212d57c3735e35e0 (diff) | |
download | vyos-cloud-init-2ecefdf51cd93b593bea450b4d751021da91e748.tar.gz vyos-cloud-init-2ecefdf51cd93b593bea450b4d751021da91e748.zip |
change 'default' encoding to be "None"
Instead of just trying to see if userdata decodes as the indication that
it should be encoded, the user must explicitly set this.
The "just try it" will fail in the case where the user had other use
of user-data and wanted a blob of data to go through unrecognized by
cloud-init.
In cases where there can be mistake in automatic behavior,
and some users may be relaying on old behavior, its best to just require
explicit use.
Diffstat (limited to 'cloudinit/sources')
-rw-r--r-- | cloudinit/sources/DataSourceOpenNebula.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/sources/DataSourceOpenNebula.py b/cloudinit/sources/DataSourceOpenNebula.py index d91b80ab..34557f8b 100644 --- a/cloudinit/sources/DataSourceOpenNebula.py +++ b/cloudinit/sources/DataSourceOpenNebula.py @@ -422,8 +422,9 @@ def read_context_disk_dir(source_dir, asuser=None): # b64decode user data if necessary (default) if 'userdata' in results: - userdata_encoding = context.get('USERDATA_ENCODING', None) - if userdata_encoding in (None, "base64"): + encoding = context.get('USERDATA_ENCODING', + context.get('USER_DATA_ENCODING')) + if encoding == "base64": try: results['userdata'] = base64.b64decode(results['userdata']) except TypeError: |