diff --git a/func/overlord/client.py b/func/overlord/client.py index 12b4c61..7c9b87b 100755 --- a/func/overlord/client.py +++ b/func/overlord/client.py @@ -114,11 +114,15 @@ class Minions(object): #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) - # use basename to trim off any excess /'s, fix - # ticket #53 "Trailing slash in certmaster.conf confuses glob function + # use basename to trim off any excess /'s, fix + # ticket #53 "Trailing slash in certmaster.conf confuses glob function certname = os.path.basename(cert.replace(self.config.certroot, "")) host = certname[:-(len(self.config.cert_extension) + 1)] self.all_hosts.append(host) + # request the list of hosts from our certmaster/overlord if + # we are not them + # if the each_gloob matches anything in that list, add the matching + # items to self.all_hosts def get_all_hosts(self): self._get_new_hosts() @@ -205,15 +209,20 @@ class Overlord(object): # certmaster key, cert, ca # funcd key, cert, ca # raise FuncClientError + # use these if we're the certmaster and 'true' overlord ol_key = '%s/certmaster.key' % self.config.cadir ol_crt = '%s/certmaster.crt' % self.config.cadir - myname = utils.get_hostname(talk_to_certmaster=False) + ol_ca = ol_crt + # use these if we're a pretender to the overlord throne # FIXME: should be config -akl? # maybe /etc/pki/func is a variable somewhere? + myname = utils.get_hostname(talk_to_certmaster=False) fd_key = '/etc/pki/certmaster/%s.pem' % myname fd_crt = '/etc/pki/certmaster/%s.cert' % myname - self.ca = '%s/certmaster.crt' % self.config.cadir + fd_ca = '/etc/pki/certmaster/ca.cert' + + # if the callers passes in their own use those if client_key and client_cert and ca: if (os.access(client_key, os.R_OK) and os.access(client_cert, os.R_OK) and os.access(ca, os.R_OK)): @@ -224,9 +233,11 @@ class Overlord(object): elif os.access(ol_key, os.R_OK) and os.access(ol_crt, os.R_OK): self.key = ol_key self.cert = ol_crt + self.ca = ol_ca elif os.access(fd_key, os.R_OK) and os.access(fd_crt, os.R_OK): self.key = fd_key self.cert = fd_crt + self.ca = fd_ca else: raise Func_Client_Exception, 'Cannot read ssl credentials: ssl, cert, ca. '+\ 'Ensure you have permission to read files in /etc/pki/certmaster/ directory.'