summaryrefslogtreecommitdiff
path: root/tests/unittests/test_data.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2019-10-24 20:02:15 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2019-10-24 20:02:15 +0000
commit5bec6b0e2a2ce5fd03bb04f441536fc130e67997 (patch)
treed4fbc5ae8d7360ff87c283c2550f4661ef007dff /tests/unittests/test_data.py
parent3e2482e8aa6630ca9bc115dc1f82d44d3fde1681 (diff)
downloadvyos-cloud-init-5bec6b0e2a2ce5fd03bb04f441536fc130e67997.tar.gz
vyos-cloud-init-5bec6b0e2a2ce5fd03bb04f441536fc130e67997.zip
Fix usages of yaml, and move yaml_dump to safeyaml.dumps.
Here we replace uses of the pyyaml module directly with functions provided by cloudinit.safeyaml. Also, change/move cloudinit.util.yaml_dumps to cloudinit.safeyaml.dumps LP: #1849640
Diffstat (limited to 'tests/unittests/test_data.py')
-rw-r--r--tests/unittests/test_data.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/unittests/test_data.py b/tests/unittests/test_data.py
index 3efe7adf..22cf8f28 100644
--- a/tests/unittests/test_data.py
+++ b/tests/unittests/test_data.py
@@ -27,6 +27,7 @@ from cloudinit.settings import (PER_INSTANCE)
from cloudinit import sources
from cloudinit import stages
from cloudinit import user_data as ud
+from cloudinit import safeyaml
from cloudinit import util
from cloudinit.tests import helpers
@@ -502,7 +503,7 @@ c: 4
data = [{'content': '#cloud-config\npassword: gocubs\n'},
{'content': '#cloud-config\nlocale: chicago\n'},
{'content': non_decodable}]
- message = b'#cloud-config-archive\n' + util.yaml_dumps(data).encode()
+ message = b'#cloud-config-archive\n' + safeyaml.dumps(data).encode()
self.reRoot()
ci = stages.Init()