From 7101e1738e4f715c826d078ec151a9ce3d18da4d Mon Sep 17 00:00:00 2001 From: Marek Skrobacki Date: Wed, 27 Nov 2024 12:03:11 +0000 Subject: [PATCH] enroll: make flavor spec directory configurable --- .../understack_workflows/flavor_detect.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/understack-workflows/understack_workflows/flavor_detect.py b/python/understack-workflows/understack_workflows/flavor_detect.py index f779c9f40..1fcca2e1c 100644 --- a/python/understack-workflows/understack_workflows/flavor_detect.py +++ b/python/understack-workflows/understack_workflows/flavor_detect.py @@ -1,3 +1,5 @@ +import os + from flavor_matcher.machine import Machine from flavor_matcher.matcher import FlavorSpec from flavor_matcher.matcher import Matcher @@ -8,7 +10,8 @@ from understack_workflows.helpers import setup_logger logger = setup_logger(__name__) -FLAVORS = FlavorSpec.from_directory("/etc/understack_flavors/") +FLAVORS_DIR = os.getenv("FLAVORS_DIR", "/etc/understack_flavors/") +FLAVORS = FlavorSpec.from_directory(FLAVORS_DIR) logger.info(f"Loaded {len(FLAVORS)} flavor specifications.")