diff options
author | Scott Moser <smoser@ubuntu.com> | 2015-02-26 14:10:17 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2015-02-26 14:10:17 -0500 |
commit | c9c811b2c3bad00cc1f0a3db6b7173bab3b1a7ad (patch) | |
tree | 6f36dc496da710a02562f52d05c676b2c8479377 /tests/unittests/test_datasource/test_openstack.py | |
parent | e2fea567772f3d178072607aee617c3792185db0 (diff) | |
parent | 0ebca9c158c87b28fb61974e9e36e645cf60494c (diff) | |
download | vyos-cloud-init-c9c811b2c3bad00cc1f0a3db6b7173bab3b1a7ad.tar.gz vyos-cloud-init-c9c811b2c3bad00cc1f0a3db6b7173bab3b1a7ad.zip |
readurl, read_file_or_url returns bytes, user must convert as necessary
* explicitly test compressed user-data.
* userdata_raw is now bytes
* add load_tfile_or_url for loading text file or url
* ec2_utils: all meta-data is text, remove non-obvious string translations
* DigitalOcean: adjust for ec2_utils
* DataSourceGCE, DataSourceMAAS: user-data is binary other fields are text.
* openstack.py: read paths without decoding to text. This is ok as paths
other than user-data are json, and load_json will handle
* load_file still returns text, and that is what most things use.
LP: #1424900
Diffstat (limited to 'tests/unittests/test_datasource/test_openstack.py')
-rw-r--r-- | tests/unittests/test_datasource/test_openstack.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unittests/test_datasource/test_openstack.py b/tests/unittests/test_datasource/test_openstack.py index 81ef1546..81411ced 100644 --- a/tests/unittests/test_datasource/test_openstack.py +++ b/tests/unittests/test_datasource/test_openstack.py @@ -49,7 +49,7 @@ EC2_META = { 'public-ipv4': '0.0.0.1', 'reservation-id': 'r-iru5qm4m', } -USER_DATA = '#!/bin/sh\necho This is user data\n' +USER_DATA = b'#!/bin/sh\necho This is user data\n' VENDOR_DATA = { 'magic': '', } @@ -63,8 +63,8 @@ OSTACK_META = { 'public_keys': {'mykey': PUBKEY}, 'uuid': 'b0fa911b-69d4-4476-bbe2-1c92bff6535c', } -CONTENT_0 = 'This is contents of /etc/foo.cfg\n' -CONTENT_1 = '# this is /etc/bar/bar.cfg\n' +CONTENT_0 = b'This is contents of /etc/foo.cfg\n' +CONTENT_1 = b'# this is /etc/bar/bar.cfg\n' OS_FILES = { 'openstack/latest/meta_data.json': json.dumps(OSTACK_META), 'openstack/latest/user_data': USER_DATA, |