Skip to content

Commit 414b57d

Browse files
committed
Create inventory file if absent when loading
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.
1 parent c230772 commit 414b57d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

manifester/helpers.py

+2
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ def load_inventory_file(file):
154154
155155
:return: list of dictionaries
156156
"""
157+
if not file.is_file():
158+
file.touch()
157159
if file.suffix not in (".yaml", ".yml"):
158160
logger.warn(
159161
f"Found invalid inventory file {file}. Inventory file must exist and "

0 commit comments

Comments
 (0)