diff options
author | makkalot <makkalot@gmail.com> | 2008-07-29 14:34:08 +0300 |
---|---|---|
committer | makkalot <makkalot@gmail.com> | 2008-08-01 23:30:46 +0300 |
commit | 3fb2de01734d1d61ff5b3c2bc48d00b9236f0b4b (patch) | |
tree | 6b888f3877e73189762ea3045a2f42f424bb7d16 | |
parent | f2b04a97b04e5233ceb0021f470bcbd95116c128 (diff) | |
download | func-3fb2de01734d1d61ff5b3c2bc48d00b9236f0b4b.tar.gz func-3fb2de01734d1d61ff5b3c2bc48d00b9236f0b4b.tar.xz func-3fb2de01734d1d61ff5b3c2bc48d00b9236f0b4b.zip |
some changes into Minions class to work properly with Group class
(cherry picked from commit e24c78c1b6915dc30acefb9d68c83635cb3812ba)
-rwxr-xr-x | func/overlord/client.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/func/overlord/client.py b/func/overlord/client.py index fdb8ec8..b02438d 100755 --- a/func/overlord/client.py +++ b/func/overlord/client.py @@ -94,20 +94,26 @@ class Minions(object): self.all_urls = [] def _get_new_hosts(self): - self.new_hosts = self.group_class.get_hosts_by_groupgoo(self.spec) + self.new_hosts = self.group_class.get_hosts_by_group_glob(self.spec) return self.new_hosts def _get_all_hosts(self): seperate_gloobs = self.spec.split(";") seperate_gloobs = seperate_gloobs + self.new_hosts for each_gloob in seperate_gloobs: + #if there is some string from group glob just skip it + if each_gloob.startswith('@'): + continue actual_gloob = "%s/%s.%s" % (self.config.certroot, each_gloob, self.config.cert_extension) certs = glob.glob(actual_gloob) for cert in certs: - self.all_certs.append(cert) - host = cert.replace(self.config.certroot,"")[1:-(len(self.config.cert_extension) + 1)] - self.all_hosts.append(host) - return self.all_hosts + #if the spec includes some groups and also it includes some * + #may cause some duplicates so should check that + #For example spec = "@home_group;*" will give lots of duplicates as a result + if not cert in self.all_certs: + self.all_certs.append(cert) + host = cert.replace(self.config.certroot,"")[1:-(len(self.config.cert_extension) + 1)] + self.all_hosts.append(host) def get_all_hosts(self): self._get_new_hosts() |