summaryrefslogtreecommitdiffstats
path: root/func/minion/modules/overlord.py
diff options
context:
space:
mode:
Diffstat (limited to 'func/minion/modules/overlord.py')
-rw-r--r--func/minion/modules/overlord.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/func/minion/modules/overlord.py b/func/minion/modules/overlord.py
index 710f6d1..743c672 100644
--- a/func/minion/modules/overlord.py
+++ b/func/minion/modules/overlord.py
@@ -30,12 +30,20 @@ class OverlordModule(func_module.FuncModule):
ping_results = fc.Overlord("*").test.ping()
for minion in ping_results.keys():
if ping_results[minion] == 1: #if minion is alive
- current_minions.append(minion) #add it to the list of current minions
+ current_minions.append(minion) #add it to the list
else:
cm = certmaster.CertMaster()
current_minions = cm.get_signed_certs()
for current_minion in current_minions:
- maphash[current_minion] = fc.Overlord(current_minion).overlord.map_minions()[current_minion]
+ if current_minion in utils.get_hostname():
+ maphash[current_minion] = {} #prevent infinite recursion
+ else:
+ next_hop = fc.Overlord(current_minion)
+ mapresults = next_hop.overlord.map_minions()[current_minion]
+ if not utils.is_error(mapresults):
+ maphash[current_minion] = mapresults
+ else:
+ maphash[current_minion] = {}
return maphash