tools/: use safe yaml loading

YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as
the default Loader is unsafe. Please read https://msg.pyyaml.org/load for
full details.
This commit is contained in:
Hans-Christoph Steiner 2022-06-17 09:29:32 +02:00
parent 34bf48aac3
commit 7c98192b77
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA
2 changed files with 2 additions and 2 deletions

View file

@ -11,7 +11,7 @@ os.chdir(os.path.dirname(__file__) + '/../')
for f in glob.glob('metadata/*.yml'):
with open(f) as fp:
raw = fp.read()
data = yaml.load(raw)
data = yaml.safe_load(raw)
archive_policy = data.get('ArchivePolicy')
if (
'Disabled' not in data

View file

@ -21,7 +21,7 @@ else:
pattern = re.compile(r'Repo: .*')
for f in files:
with open(f) as fp:
data = yaml.load(fp)
data = yaml.safe_load(fp)
repo_url = None
if 'Repo' in data:
repo_url = data['Repo'].strip().rstrip('/')