Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate config file exists before using #131

Merged
merged 4 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flytekit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

import flytekit.plugins

__version__ = '0.10.3'
__version__ = '0.10.4'
4 changes: 4 additions & 0 deletions flytekit/configuration/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import absolute_import
import logging as _logging
import os as _os
import six as _six

Expand All @@ -16,8 +17,11 @@ def set_flyte_config_file(config_file_path):
import flytekit.configuration.internal as _internal
if config_file_path is not None:
config_file_path = _os.path.abspath(config_file_path)
if not _pathlib.Path(config_file_path).is_file():
_logging.warning("Invalid flyte config_file_path {} specified.".format(config_file_path))
_os.environ[_internal.CONFIGURATION_PATH.env_var] = config_file_path
elif _internal.CONFIGURATION_PATH.env_var in _os.environ:
_logging.debug("Deleting configuration path {} from env".format(_internal.CONFIGURATION_PATH.env_var))
del _os.environ[_internal.CONFIGURATION_PATH.env_var]
_common.CONFIGURATION_SINGLETON.reset_config(config_file_path)

Expand Down