From 460d3fc53bdbd0c67a74f98b2d67e8ff6c5412f2 Mon Sep 17 00:00:00 2001 From: Adam Thornton Date: Tue, 26 Mar 2024 13:13:53 -0700 Subject: [PATCH] update bucketmaker for rearranged Phalanx project structure --- src/rubin_influx_tools/bucketmaker.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/rubin_influx_tools/bucketmaker.py b/src/rubin_influx_tools/bucketmaker.py index 31ada3d..2ee1d60 100644 --- a/src/rubin_influx_tools/bucketmaker.py +++ b/src/rubin_influx_tools/bucketmaker.py @@ -61,16 +61,15 @@ async def check_phalanx(self) -> Set[str]: for yml in yamls: with open(yml, "r") as f: ydoc = yaml.safe_load(f) - self.log.debug(f"{yml} -> {ydoc}") - for yk in ydoc: - obj = ydoc[yk] - # If the top-level key is itself an object, and if - # that object has an "enabled" field, and that field - # is truthy, that key represents an enabled Phalanx - # application. - if type(obj) is dict: - if obj.get("enabled"): - enabled.add(yk.replace("-", "_")) + # The applications are under the "applications" key. + # But Chart.yaml doesn't have one of those. + apps = ydoc.get("applications", {}) + self.log.debug(f"{yml} applications -> {apps}") + for app in apps: + # The value will be true if the application is + # enabled. + if app: + enabled.add(app.replace("-", "_")) return enabled async def list_buckets(self) -> List[BucketGet]: