Merge ~adam-collard/maas-ci/+git/system-tests:yaml-split-config-check into ~maas-committers/maas-ci/+git/system-tests:master

Proposed by Adam Collard
Status: Merged
Approved by: Adam Collard
Approved revision: d3aa37f0f5f7c247dd283077c8ac0bb268ddbaed
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~adam-collard/maas-ci/+git/system-tests:yaml-split-config-check
Merge into: ~maas-committers/maas-ci/+git/system-tests:master
Diff against target: 40 lines (+5/-2)
2 files modified
setup.py (+1/-0)
systemtests/conftest.py (+4/-2)
Reviewer Review Type Date Requested Status
Anton Troyanov Approve
MAAS Lander Approve
Review via email: mp+428531@code.launchpad.net

Commit message

Use ruamel.yaml to parse YAML 1.2 docs that come out of gen_config

Avoids issue with "no" -> no -> False

To post a comment you must log in.
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b yaml-split-config-check lp:~adam-collard/maas-ci/+git/system-tests into -b master lp:~maas-committers/maas-ci/+git/system-tests

STATUS: SUCCESS
COMMIT: d3aa37f0f5f7c247dd283077c8ac0bb268ddbaed

review: Approve
Revision history for this message
Anton Troyanov (troyanov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/setup.py b/setup.py
2index 10c8b5e..21d75cd 100644
3--- a/setup.py
4+++ b/setup.py
5@@ -8,6 +8,7 @@ install_requires = (
6 'pytest-steps',
7 'pyyaml',
8 'retry',
9+ 'ruamel.yaml',
10 )
11
12
13diff --git a/systemtests/conftest.py b/systemtests/conftest.py
14index e669a69..234c9fa 100644
15--- a/systemtests/conftest.py
16+++ b/systemtests/conftest.py
17@@ -4,7 +4,7 @@ from logging import getLogger
18 from typing import TYPE_CHECKING, Any, Iterator
19
20 import pytest
21-import yaml
22+from ruamel.yaml import YAML
23
24 if TYPE_CHECKING:
25 from .api import AuthenticatedAPIClient
26@@ -75,11 +75,13 @@ STATUS_READY = 4
27
28 LOG = getLogger("systemtests.conftest")
29
30+yaml = YAML()
31+
32
33 def pytest_addoption(parser: Parser) -> None:
34 def config_type(filename: str) -> dict[str, Any]:
35 with open(filename, "r") as fh:
36- config: dict[str, Any] = yaml.safe_load(fh)
37+ config: dict[str, Any] = yaml.load(fh)
38 return config
39
40 parser.addoption(

Subscribers

People subscribed via source and target branches

to all changes: