Skip to content

Commit

Permalink
I-76 replace yaml.load to yaml.safe_load
Browse files Browse the repository at this point in the history
  • Loading branch information
p.fomin committed Jan 14, 2019
1 parent dec5c73 commit 135a4a9
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 135a4a9

Please sign in to comment.