From 32e4704789a8a909e253714457ca89f69d7fd242 Mon Sep 17 00:00:00 2001 From: Mikey Boldt Date: Fri, 29 Jul 2022 11:11:52 -0500 Subject: [PATCH] Fix a couple more PyYAML signature changes --- sample/diff_tile_metadata_yaml.py | 6 +++--- tile_generator/tile_metadata.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sample/diff_tile_metadata_yaml.py b/sample/diff_tile_metadata_yaml.py index 10be4294..26b7e3e9 100755 --- a/sample/diff_tile_metadata_yaml.py +++ b/sample/diff_tile_metadata_yaml.py @@ -14,8 +14,8 @@ with open(sys.argv[2], 'r') as f: b = f.read() -aa = yaml.load(a) -bb = yaml.load(b) +aa = yaml.load(a, yaml.Loader) +bb = yaml.load(b, yaml.Loader) for conf in [aa, bb]: for release in conf['releases']: @@ -26,7 +26,7 @@ conf.pop('provides_product_versions') conf['property_blueprints'] = sorted(conf['property_blueprints'], key=lambda k: k['name']) conf['job_types'] = sorted(conf['job_types'], key=lambda k: k['name']) - for x in conf['job_types']: x['manifest'] = sorted(x['manifest'].items()) if type(x['manifest']) is dict else sorted(yaml.load(x['manifest']).items()) + for x in conf['job_types']: x['manifest'] = sorted(x['manifest'].items()) if type(x['manifest']) is dict else sorted(yaml.load(x['manifest'], yaml.Loader).items()) from pprint import pprint for x in list(dictdiffer.diff(aa,bb)): pprint(x); print('') diff --git a/tile_generator/tile_metadata.py b/tile_generator/tile_metadata.py index e6054485..ce36e2b1 100644 --- a/tile_generator/tile_metadata.py +++ b/tile_generator/tile_metadata.py @@ -554,7 +554,7 @@ def match_job_specific_prop_blueprints(job_name, prop_blueprints): } if template.get('consumes'): if type(template.get('consumes')) is not dict: - template['consumes'] = yaml.load(template['consumes']) + template['consumes'] = yaml.load(template['consumes'], yaml.Loader) temp['consumes'] = literal_unicode(yaml.dump(template.get('consumes'), default_flow_style=False)) if template.get('provides'): temp['provides'] = literal_unicode(yaml.dump(template.get('provides'), default_flow_style=False))