From e70e290f3f8674afb83ddb67a808b10f0c1d3cb5 Mon Sep 17 00:00:00 2001 From: Peter Sabaini Date: Fri, 19 Apr 2024 12:24:35 +0200 Subject: [PATCH] Fix: update-metadata yaml handling It looks like ruamel might have changed its interface --- _update-metadata.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_update-metadata.py b/_update-metadata.py index 276dc70..7dfe510 100755 --- a/_update-metadata.py +++ b/_update-metadata.py @@ -11,9 +11,7 @@ import sys import collections -# from ruamel.yaml import YAML -import ruamel.yaml as YAML - +from ruamel.yaml import YAML Command = collections.namedtuple('Command', ['charm', 'cmd', 'params']) @@ -80,12 +78,14 @@ def metadata_file(cmd): def load_yaml(cmd): with open(metadata_file(cmd)) as f: - return YAML.load(f, YAML.RoundTripLoader) + yaml = YAML(typ='rt') + return yaml.load(f) def write_yaml(cmd, yml): with open(metadata_file(cmd), "w") as f: - YAML.dump(yml, f, Dumper=YAML.RoundTripDumper) + yaml = YAML(typ='rt') + yaml.dump(yml, f) def list_series(yml):