summaryrefslogtreecommitdiffstats
path: root/func/overlord
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-01-29 16:19:45 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-01-29 16:19:45 -0500
commit168f3ec79a2fbee4addf5e4d131a46325ad9c231 (patch)
tree7801f2c156ec266a8c5f41aae446013998fa3e2e /func/overlord
parentb3c5591d70c1c354d14267e804ab64872af97b40 (diff)
parent41766553ea364808ed336066a758d3366d040fe3 (diff)
downloadthird_party-func-168f3ec79a2fbee4addf5e4d131a46325ad9c231.tar.gz
third_party-func-168f3ec79a2fbee4addf5e4d131a46325ad9c231.tar.xz
third_party-func-168f3ec79a2fbee4addf5e4d131a46325ad9c231.zip
Merge branch 'master' of ssh://git.fedoraproject.org/git/hosted/func
Diffstat (limited to 'func/overlord')
-rwxr-xr-xfunc/overlord/client.py32
1 files changed, 21 insertions, 11 deletions
diff --git a/func/overlord/client.py b/func/overlord/client.py
index e293f1c..3d00302 100755
--- a/func/overlord/client.py
+++ b/func/overlord/client.py
@@ -62,6 +62,23 @@ class CommandAutomagic(object):
return self.clientref.run(module,method,args,nforks=self.nforks)
+def get_groups():
+ group_class = groups.Groups()
+ return group_class.get_groups()
+
+
+def get_hosts_by_groupgoo(groups, groupgoo):
+ group_gloobs = groupgoo.split(':')
+ hosts = []
+ for group_gloob in group_gloobs:
+ if not group_gloob[0] == "@":
+ continue
+ if groups.has_key(group_gloob[1:]):
+ hosts = hosts + groups[group_gloob[1:]]
+ else:
+ print "group %s not defined" % each_gloob
+ return hosts
+
# ===================================
# this is a module level def so we can use it and isServer() from
# other modules with a Client class
@@ -83,22 +100,15 @@ def expand_servers(spec, port=51234, noglobs=None, verbose=None, just_fqdns=Fals
else:
return spec
- group_class = groups.Groups()
- group_dict = group_class.get_groups()
+ group_dict = get_groups()
all_hosts = []
all_certs = []
seperate_gloobs = spec.split(";")
- new_hosts = []
-
- # we notate groups with @foo annotation, so look for that in the hostnamegoo
- for each_gloob in seperate_gloobs:
- if each_gloob[0] == '@':
- if group_dict.has_key(each_gloob[1:]):
- new_hosts = new_hosts + group_dict[each_gloob[1:]]
- else:
- print "group %s not defined" % each_gloob
+
+ new_hosts = get_hosts_by_groupgoo(group_dict, spec)
+ seperate_gloobs = spec.split(";")
seperate_gloobs = seperate_gloobs + new_hosts
for each_gloob in seperate_gloobs:
actual_gloob = "%s/%s.cert" % (config.certroot, each_gloob)