Merge pull request #13816 from ninjadq/cherry_pick_python_yaml_load_210

Fix pythom yaml load to safe_load
This commit is contained in:
Qian Deng 2021-01-04 10:51:17 +08:00 committed by GitHub
commit 591d4eeab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,7 @@ def parse_versions():
if not versions_file_path.is_file(): if not versions_file_path.is_file():
return {} return {}
with open('versions') as f: with open('versions') as f:
versions = yaml.load(f) versions = yaml.safe_load(f)
return versions return versions
@ -92,7 +92,7 @@ def parse_yaml_config(config_file_path, with_notary, with_clair, with_trivy, wit
''' '''
with open(config_file_path) as f: with open(config_file_path) as f:
configs = yaml.load(f) configs = yaml.safe_load(f)
config_dict = { config_dict = {
'portal_url': 'http://portal:8080', 'portal_url': 'http://portal:8080',