Skip to content

Commit

Permalink
Fix yaml loading in tests (#2698) (#2700)
Browse files Browse the repository at this point in the history
Co-authored-by: Konstantinos Tsakalozos <kos.tsakalozos@canonical.com>
  • Loading branch information
neoaggelos and ktsakalozos authored Nov 3, 2021
1 parent dcafa84 commit c493d80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test-addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_invalid_addon(self):
sh.microk8s.enable.foo()

def test_help_text(self):
status = yaml.load(sh.microk8s.status(format="yaml").stdout)
status = yaml.safe_load(sh.microk8s.status(format="yaml").stdout)
expected = {a["name"]: "disabled" for a in status["addons"]}
expected["ha-cluster"] = "enabled"

Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def kubectl_get(target, timeout_insec=300):
"""
cmd = "get -o yaml " + target
output = kubectl(cmd, timeout_insec)
return yaml.load(output)
return yaml.safe_load(output)


def wait_for_pod_state(
Expand Down

0 comments on commit c493d80

Please sign in to comment.