Skip to content

Commit

Permalink
Replace config file string with a constant of the path (#933)
Browse files Browse the repository at this point in the history
* replace config file with a constant of the path

* changelog
  • Loading branch information
SteveDMurphy authored Jul 22, 2022
1 parent 61fbcc7 commit 32baffe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ The types of changes are:
* Endpoints now work with or without a trailing slash. [#886](https://github.com/ethyca/fides/pull/886)
* Dataset field columns show all columns by default in the UI [#898](https://github.com/ethyca/fides/pull/898)
* Fixed the `tag` specific GitHub Action workflows for Docker and publishing docs. [#901](https://github.com/ethyca/fides/pull/901)
* Fixed the missing `.fides./` directory when locating the default config [#933](https://github.com/ethyca/fides/pull/933)

## [1.7.0](https://github.com/ethyca/fides/compare/1.6.1...1.7.0) - 2022-06-23

Expand Down
4 changes: 3 additions & 1 deletion src/fidesctl/core/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from .security_settings import FidesctlSecuritySettings
from .user_settings import FidesctlUserSettings

DEFAULT_CONFIG_PATH = ".fides/fidesctl.toml"


class FidesctlConfig(BaseModel):
"""Umbrella class that encapsulates all of the config subsections."""
Expand All @@ -44,7 +46,7 @@ def get_config(config_path_override: str = "") -> FidesctlConfig:
settings = (
toml.load(config_path_override)
if config_path_override
else load_toml(file_names=["fidesctl.toml"])
else load_toml(file_names=[DEFAULT_CONFIG_PATH])
)

# credentials specific logic for populating environment variable configs.
Expand Down
10 changes: 8 additions & 2 deletions src/fidesctl/core/config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from fideslib.core.config import load_file
from toml import dump, load

from fidesctl.core.config import DEFAULT_CONFIG_PATH


def get_config_from_file(
config_path_override: str,
Expand All @@ -15,7 +17,9 @@ def get_config_from_file(
"""

try:
config_path = config_path_override or load_file(file_names=["fidesctl.toml"])
config_path = config_path_override or load_file(
file_names=[DEFAULT_CONFIG_PATH]
)
except FileNotFoundError as error:
raise error

Expand All @@ -42,7 +46,9 @@ def update_config_file( # type: ignore
"""

try:
config_path = config_path_override or load_file(file_names=["fidesctl.toml"])
config_path = config_path_override or load_file(
file_names=[DEFAULT_CONFIG_PATH]
)
except FileNotFoundError as error:
raise error

Expand Down

0 comments on commit 32baffe

Please sign in to comment.