Skip to content

Commit

Permalink
Always initialize config, simplify config path
Browse files Browse the repository at this point in the history
  • Loading branch information
psss committed Dec 3, 2024
1 parent 18777f7 commit 1efb3b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fmf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def __init__(self, data, name=None, parent=None):
self.data = dict()
self.sources = list()
self.root = None
self.config = {}
self.version = utils.VERSION
self.original_data = dict()
self._commit = None
Expand Down Expand Up @@ -175,13 +176,12 @@ def _initialize(self, path):
raise utils.FormatError("Invalid version format")

# Check for the config file
config_file_path = Path(self.root) / ".fmf" / "config"
config_file_path = Path(self.root) / ".fmf/config"
try:
self.config = YAML(typ="safe").load(config_file_path.read_text())
log.debug(f"Config file '{config_file_path}' loaded.")
except FileNotFoundError:
log.debug("Config file not found.")
self.config = {}
except YAMLError as error:
raise utils.FileError(f"Failed to parse '{config_file_path}'.\n{error}")

Expand Down

0 comments on commit 1efb3b5

Please sign in to comment.