Discussion:
func/overlord
Greg Swift
2011-03-22 02:33:22 UTC
Permalink
func/overlord/client.py | 13 +++++++------
func/overlord/delegation_tools.py | 10 +++++-----
2 files changed, 12 insertions(+), 11 deletions(-)

New commits:
commit c8dd4f718ca3df5992cf762a51a3b397a03ff7de
Author: Greg Swift <gregswift-***@public.gmane.org>
Date: Mon Mar 21 21:07:10 2011 -0500

adjusted glob parsing in overlord client and delegation_tools to properly "resolve" fqdn globs for systems that rely on CNAME instead of A+PTR

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):

Loading...