diff options
author | Scott Moser <smoser@brickies.net> | 2020-06-22 14:44:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-22 14:44:37 -0400 |
commit | 76652f3e07b6f659b2fd166a6619cb427dc6bc7e (patch) | |
tree | 75a6d70ac0aaae5a4cc766661fca742b599ee663 /tests/unittests/test_ds_identify.py | |
parent | 055731eade79d4121d1005469765207e425ac343 (diff) | |
download | vyos-cloud-init-76652f3e07b6f659b2fd166a6619cb427dc6bc7e.tar.gz vyos-cloud-init-76652f3e07b6f659b2fd166a6619cb427dc6bc7e.zip |
Hetzner: support reading user-data that is base64 encoded. (#448)
Hetzner cloud only supports user-data as a string (presumably utf-8).
In order to allow users on Hetzner to provide binary data to cloud-init,
we will attempt to base64decode the userdata.
The change here adds a 'maybe_b64decode' function that will decode data
if and only if is base64 encoded.
The reason for not using util.b64d is that we do not want the return value
decoded to a string, and util.b64d will do that if it can. Additionally
we call decode with validate=True which oddly is not the default.
LP: #1884071
Diffstat (limited to 'tests/unittests/test_ds_identify.py')
0 files changed, 0 insertions, 0 deletions