From 7fa110e465553629423ef70198707e6ae7d2b4e1 Mon Sep 17 00:00:00 2001 From: Florian Paul Azim Hoberg Date: Mon, 27 Oct 2025 14:49:40 +0100 Subject: [PATCH] fix: Make pool based configuration more robust Fixes: #343 --- proxlb/models/tags.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxlb/models/tags.py b/proxlb/models/tags.py index f20c937..dcff6e0 100644 --- a/proxlb/models/tags.py +++ b/proxlb/models/tags.py @@ -109,7 +109,7 @@ class Tags: if len(pools) > 0: for pool in pools: - if pool in proxlb_config['balancing'].get('pools', []): + if pool in (proxlb_config['balancing'].get('pools') or {}): if proxlb_config['balancing']['pools'][pool].get('type', None) == 'affinity': logger.debug(f"Adding affinity group for pool {pool}.") affinity_tags.append(pool) @@ -149,7 +149,7 @@ class Tags: if len(pools) > 0: for pool in pools: - if pool in proxlb_config['balancing'].get('pools', []): + if pool in (proxlb_config['balancing'].get('pools') or {}): if proxlb_config['balancing']['pools'][pool].get('type', None) == 'anti-affinity': logger.debug(f"Adding anti-affinity group for pool {pool}.") anti_affinity_tags.append(pool) @@ -222,7 +222,7 @@ class Tags: if len(pools) > 0: logger.debug("Validating node pinning by pools.") for pool in pools: - if pool in proxlb_config['balancing'].get('pools', []): + if pool in (proxlb_config['balancing'].get('pools') or {}): node = proxlb_config['balancing']['pools'][pool].get('pin', None) # Validate if the node to pin is present in the cluster