Bug 1484573 - Fix errant use of yaml.load() when yaml.safe_load() would be better. r=tomprince

Differential Revision: https://phabricator.services.mozilla.com/D3746

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Justin Wood 2018-08-20 03:23:33 +00:00
Родитель e6b9b350e4
Коммит 9197cbf364
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -19,6 +19,8 @@ from .taskgraph import TaskGraph
from .try_option_syntax import parse_message
from .actions import render_actions_json
from taskgraph.util.partials import populate_release_history
from taskgraph.util.yaml import load_yaml
logger = logging.getLogger(__name__)
@ -320,8 +322,7 @@ def write_artifact(filename, data):
def read_artifact(filename):
path = os.path.join(ARTIFACTS_DIR, filename)
if filename.endswith('.yml'):
with open(path, 'r') as f:
return yaml.load(f)
return load_yaml(path, filename)
elif filename.endswith('.json'):
with open(path, 'r') as f:
return json.load(f)