Skip to content

Commit

Permalink
Create inventory file if absent when loading
Browse files Browse the repository at this point in the history
This PR fixes an error that occurred when attempting to load the
inventory while the inventory file is not present at the
`inventory_path` location.
  • Loading branch information
synkd committed Mar 19, 2024
1 parent c230772 commit 414b57d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manifester/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def load_inventory_file(file):
:return: list of dictionaries
"""
if not file.is_file():
file.touch()
if file.suffix not in (".yaml", ".yml"):
logger.warn(
f"Found invalid inventory file {file}. Inventory file must exist and "
Expand Down

0 comments on commit 414b57d

Please sign in to comment.