From f6ee54c2457bec39c869d9526d47e977e87c702c Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Wed, 4 Aug 2010 14:25:35 -0400 Subject: [PATCH] return None for minion only setups to solve following exception; 2010-07-19 18:21:24,406 - ERROR - Exception occured: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/func/minion/server.py", line 196, in __call__ rc = self.__method(*args) File "/usr/lib/python2.5/site-packages/func/minion/modules/func_module.py", line 43, in wrapper return fn(*args) File "/usr/lib/python2.5/site-packages/func/minion/modules/overlord.py", line 36, in map_minions cm = certmaster.CertMaster() File "/usr/lib/python2.5/site-packages/certmaster/certmaster.py", line 79, in __init__ self.cacert = certs.retrieve_cert_from_file(self.ca_cert_file) File "/usr/lib/python2.5/site-packages/certmaster/certs.py", line 86, in retrieve_cert_from_file fo = open(certfile, 'r') IOError: [Errno 2] No such file or directory: '/etc/pki/certmaster/ca/certmaster.crt' --- certmaster/certmaster.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/certmaster/certmaster.py b/certmaster/certmaster.py index b0a216b..981efd8 100644 --- a/certmaster/certmaster.py +++ b/certmaster/certmaster.py @@ -64,6 +64,10 @@ class CertMaster(object): self.logger = logger.Logger().logger self.audit_logger = logger.AuditLogger() + # if ca_key_file exists and ca_cert_file is missing == minion only setup + if os.path.exists(self.ca_key_file) and not os.path.exists(self.ca_cert_file): + return + try: if not os.path.exists(self.cfg.cadir): os.makedirs(self.cfg.cadir) -- 2.39.5