From 069abbc16edf21773a8b78d245b6213202ce1f61 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/understack-workflows/understack_workflows/flavor_detect.py b/python/understack-workflows/understack_workflows/flavor_detect.py index f779c9f40..1fa9a1227 100644 --- a/python/understack-workflows/understack_workflows/flavor_detect.py +++ b/python/understack-workflows/understack_workflows/flavor_detect.py @@ -1,14 +1,17 @@ +import os + from flavor_matcher.machine import Machine from flavor_matcher.matcher import FlavorSpec from flavor_matcher.matcher import Matcher -from understack_workflows import bmc_disk from understack_workflows.bmc import Bmc from understack_workflows.bmc_chassis_info import ChassisInfo +from understack_workflows import bmc_disk 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.")