Skip to content

Commit

Permalink
Fix a couple more PyYAML signature changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mboldt committed Jul 29, 2022
1 parent c541d50 commit 32e4704
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions sample/diff_tile_metadata_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Expand All @@ -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('')
Expand Down
2 changes: 1 addition & 1 deletion tile_generator/tile_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 32e4704

Please sign in to comment.