Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: update-metadata yaml handling #297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions _update-metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand Down Expand Up @@ -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):
Expand Down