Skip to content

Commit

Permalink
Validate config file exists before using (flyteorg#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
katrogan authored Jul 13, 2020
1 parent 79488d5 commit ceec1aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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

0 comments on commit ceec1aa

Please sign in to comment.