Remove un-necessary if block

This commit is contained in:
Oz N Tiram 2019-06-20 19:53:28 +02:00
parent 5c912f986f
commit ed67d89f9b

View File

@ -66,13 +66,12 @@ def create_from_yaml(
processing of the request.
Valid values are: - All: all dry run stages will be processed
"""
if path.exists(yaml_file):
with open(path.abspath(yaml_file)) as f:
content = f.read()
try:
yaml_file = StringIO(content)
except TypeError:
yaml_file = StringIO(content.decode('utf-8'))
with open(path.abspath(yaml_file)) as f:
content = f.read()
try:
yaml_file = StringIO(content)
except TypeError:
yaml_file = StringIO(content.decode('utf-8'))
yml_document_all = yaml.safe_load_all(yaml_file)