Skip to content

Commit 7e50e42

Browse files
committed
tools/update: use nested attribute to simplify code
Signed-off-by: Olivier Hoareau <olivier.hoareau@vates.tech>
1 parent 9e361dc commit 7e50e42

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/tools/tasks/update.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ def update_pools(inventory: Inventory) -> None:
3636
pools.append(p)
3737
hosting_pool = inventory_hosts[host]["hosting_pool"]
3838
if hosting_pool is not None:
39-
# we assume all hosts are nested, not only master
4039
if nested_hosts.get(hosting_pool) is not None:
41-
nested_hosts[hosting_pool].extend(p.hosts)
40+
nested_hosts[hosting_pool].extend([h for h in p.hosts if h.is_nested])
4241
else:
43-
nested_hosts[hosting_pool] = p.hosts
42+
nested_hosts[hosting_pool] = [h for h in p.hosts if h.is_nested]
4443
except NotAMasterHostError:
4544
logger.warning(f"[{host}] Skipping: not a master host")
4645

0 commit comments

Comments
 (0)