summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-09-15 22:50:21 -0400
committerScott Moser <smoser@brickies.net>2017-09-18 14:13:11 -0400
commit10f067d87a2d48092c593862e686c517c57b987c (patch)
tree144e1a12fe3d9dcbc2ee210a61e6069dcfcc6fe6 /tests
parente626966ee7d339b53d2c8b14a8f2ff8e3fe892ee (diff)
downloadvyos-cloud-init-10f067d87a2d48092c593862e686c517c57b987c.tar.gz
vyos-cloud-init-10f067d87a2d48092c593862e686c517c57b987c.zip
GCE: Fix usage of user-data.
This regressed in the rework of GCE datasource to have a main. The fix really just stores the user-data that was read in self.userdata_raw, rather than self.userdata. That is consistent with other datasources and ulitimately how it was before the refactor. The main is updated to address the fact that user-data is binary data and may not be able to be printed. LP: #1717598
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_datasource/test_gce.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/unittests/test_datasource/test_gce.py b/tests/unittests/test_datasource/test_gce.py
index 50e49a10..d399ae7a 100644
--- a/tests/unittests/test_datasource/test_gce.py
+++ b/tests/unittests/test_datasource/test_gce.py
@@ -23,7 +23,8 @@ GCE_META = {
'instance/zone': 'foo/bar',
'project/attributes/sshKeys': 'user:ssh-rsa AA2..+aRD0fyVw== root@server',
'instance/hostname': 'server.project-foo.local',
- 'instance/attributes/user-data': b'/bin/echo foo\n',
+ # UnicodeDecodeError below if set to ds.userdata instead of userdata_raw
+ 'instance/attributes/user-data': b'/bin/echo \xff\n',
}
GCE_META_PARTIAL = {