Skip to content

Commit

Permalink
update bucketmaker for rearranged Phalanx project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
athornton committed Mar 26, 2024
1 parent aadb0e0 commit 460d3fc
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/rubin_influx_tools/bucketmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit 460d3fc

Please sign in to comment.