Merge pull request #1906 from jberry-suse/yaml-safe-load

Replace deprecated (and not advised) yaml.load() with yaml.safe_load().
This commit is contained in:
Stephan Kulow 2019-03-20 06:32:48 +01:00 committed by GitHub
commit a13930afd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -698,7 +698,7 @@ class StagingAPI(object):
def load_prj_pseudometa(self, description_text): def load_prj_pseudometa(self, description_text):
try: try:
data = yaml.load(description_text) data = yaml.safe_load(description_text)
if isinstance(data, str) or data is None: if isinstance(data, str) or data is None:
data = {} data = {}
except (TypeError, AttributeError): except (TypeError, AttributeError):

View File

@ -94,7 +94,7 @@ class ToTestBase(object):
def load_issues_to_ignore(self): def load_issues_to_ignore(self):
text = self.api.attribute_value_load('IgnoredIssues') text = self.api.attribute_value_load('IgnoredIssues')
if text: if text:
root = yaml.load(text) root = yaml.safe_load(text)
self.issues_to_ignore = root.get('last_seen') self.issues_to_ignore = root.get('last_seen')
else: else:
self.issues_to_ignore = dict() self.issues_to_ignore = dict()