Skip to content

Commit adadeaa

Browse files
committed
tools/update: create nested hosts list
Signed-off-by: Olivier Hoareau <olivier.hoareau@vates.tech>
1 parent bf24760 commit adadeaa

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/tools/tasks/update.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ def update_pools(inventory: dict) -> None:
2626
inventory_hosts = inventory["hosts"]
2727
# init related pools
2828
pools = []
29+
nested_hosts = []
2930
for h in inventory_hosts:
3031
try:
3132
p = Pool(h)
3233
pools.append(p)
34+
if inventory_hosts[h]["nested"]:
35+
# we assume secondary are nested when master is nested
36+
nested_hosts.extend(p.hosts)
3337
except NotAMasterHostError:
3438
logger.warning(f"[{h}] Skipping: not a master host")
3539

0 commit comments

Comments
 (0)