diff --git a/kubernetes/utils/create_from_yaml.py b/kubernetes/utils/create_from_yaml.py index 20eda3ff6..b5101174c 100644 --- a/kubernetes/utils/create_from_yaml.py +++ b/kubernetes/utils/create_from_yaml.py @@ -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)