Signed-off-by: Greg Swift <[email protected]>
---
 func/overlord/client.py           |   13 +++++++------
 func/overlord/delegation_tools.py |   10 +++++-----
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/func/overlord/client.py b/func/overlord/client.py
index 80df7fd..c893bae 100644
--- a/func/overlord/client.py
+++ b/func/overlord/client.py
@@ -150,13 +150,14 @@ class Minions(object):
 
         # if call is delegated find the shortest path to the minion and use 
the sub-overlord's certificate
         if self.delegate:
-            try:
-                each_gloob = func_utils.get_all_host_aliases(each_gloob)[0]
-                shortest_path = dtools.get_shortest_path(each_gloob, 
self.minionmap)
-            except IndexError:
+            found_path = ''
+            for gloob in func_utils.get_all_host_aliases(each_gloob):
+                shortest_path = 
dtools.get_shortest_path(each_gloob,self.minionmap)
+                if shortest_path:
+                    found_path = shortest_path[0]
+            if not found_path:
                 return tmp_hosts,tmp_certs
-            else:
-                each_gloob = shortest_path[0]
+            each_gloob = shortest_path[0]
         
         if not os.access(self.cm_config.certroot, os.R_OK):
             if self.overlord_config.allow_unknown_minions:
diff --git a/func/overlord/delegation_tools.py 
b/func/overlord/delegation_tools.py
index 55f6dd2..001cc52 100644
--- a/func/overlord/delegation_tools.py
+++ b/func/overlord/delegation_tools.py
@@ -69,11 +69,11 @@ def get_paths_for_glob(glob_list, minionmap):
 
     pathlist = []
     for glob in glob_list.split(";"):
-        glob = func_utils.get_all_host_aliases(glob)[0]
-        for elem in match_glob_in_tree(glob,minionmap):
-            result = get_shortest_path(elem,minionmap)
-            if result not in pathlist: #prevents duplicates
-                pathlist.append(result)
+        for g in func_utils.get_all_host_aliases(glob):
+            for elem in match_glob_in_tree(g,minionmap):
+                result = get_shortest_path(elem,minionmap)
+                if result not in pathlist: #prevents duplicates
+                    pathlist.append(result)
     return pathlist
 
 def list_all_minions(minionmap):
-- 
1.7.4

_______________________________________________
Func-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/func-list

Reply via email to