Discussion:
[PATCH] adjusted glob parsing in overlord client and delegation_tools to properly "resolve" fqdn globs for systems that rely on CNAME instead of A+PTR
Greg Swift
2011-03-22 02:25:25 UTC
Permalink
Signed-off-by: Greg Swift <gregswift-***@public.gmane.org>
---
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
seth vidal
2011-03-22 02:33:08 UTC
Permalink
Post by Greg Swift
---
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
# if call is delegated find the shortest path to the minion and use the sub-overlord's certificate
- each_gloob = func_utils.get_all_host_aliases(each_gloob)[0]
- shortest_path = dtools.get_shortest_path(each_gloob, self.minionmap)
+ found_path = ''
+ shortest_path = dtools.get_shortest_path(each_gloob,self.minionmap)
+ found_path = shortest_path[0]
return tmp_hosts,tmp_certs
- each_gloob = shortest_path[0]
+ each_gloob = shortest_path[0]
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
pathlist = []
- glob = func_utils.get_all_host_aliases(glob)[0]
- result = get_shortest_path(elem,minionmap)
- if result not in pathlist: #prevents duplicates
- pathlist.append(result)
+ result = get_shortest_path(elem,minionmap)
+ if result not in pathlist: #prevents duplicates
+ pathlist.append(result)
return pathlist
ACK
-sv

Loading...