Skip to content

Commit

Permalink
Merge pull request #77 from 2gis/I-76-yaml-safe-load
Browse files Browse the repository at this point in the history
I-76 replace yaml.load to yaml.safe_load
  • Loading branch information
dekhtyarev committed Jan 15, 2019
2 parents dec5c73 + 135a4a9 commit 801d703
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion k8s_handle/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class InvalidYamlError(Exception):
def load_yaml(path):
try:
with open(path) as f:
return yaml.load(f.read())
return yaml.safe_load(f.read())
except Exception as e:
raise InvalidYamlError("file '{}' doesn't contain valid yaml: {}".format(
path, e))
Expand Down
2 changes: 1 addition & 1 deletion k8s_handle/templating.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TemplateRenderingError(Exception):
def get_template_contexts(file_path):
with open(file_path) as f:
try:
contexts = yaml.load_all(f.read())
contexts = yaml.safe_load_all(f.read())
except Exception as e:
raise RuntimeError('Unable to load yaml file: {}, {}'.format(file_path, e))

Expand Down

0 comments on commit 801d703

Please sign in to comment.