File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44"""
55from concurrent .futures import ThreadPoolExecutor
66
7- from lib .pool import Pool
7+ from lib .pool import NotAMasterHostError , Pool
88
99from .. import logger
1010
@@ -13,14 +13,20 @@ def update_pools(inventory: dict) -> None:
1313
1414 .. note:: Host must be a master
1515
16- Throws error if hosts are not master (primary).
16+ Every non-master hosts will be ignored
1717
1818 :param dict inventory:
1919 Each host (key) holds its own config data (values, eg: `enablerepos`).
2020 """
2121 logger .debug (f"Inventory: { inventory } " )
2222 # init related pools
23- pools = [Pool (h ) for h in inventory ]
23+ pools = []
24+ for h in inventory :
25+ try :
26+ p = Pool (h )
27+ pools .append (p )
28+ except NotAMasterHostError :
29+ logger .warning (f"[{ h } ] Skipping: not a master host" )
2430
2531 with ThreadPoolExecutor () as executor :
2632 for p in pools :
You can’t perform that action at this time.
0 commit comments