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