From 5f170585c584eb08be427b080f8c78502bbed8c6 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 28 May 2020 16:47:36 -0400 Subject: [PATCH] Adjust SUSE logic to work Finding the apache configured TLS cert location now works in an easy configuration. --- confluent_server/confluent/certutil.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/certutil.py b/confluent_server/confluent/certutil.py index 0ce4dd6f..b5b8af20 100644 --- a/confluent_server/confluent/certutil.py +++ b/confluent_server/confluent/certutil.py @@ -55,8 +55,15 @@ def get_certificate_paths(): if not keypath and os.path.exists('/etc/apache2'): # suse way for currpath, _, files in os.walk('/etc/apache2'): for fname in files: - keypath, certpath = check_apache_config(os.path.join(currpath, - fname)) + if fname.endswith('.template'): + continue + kploc = check_apache_config(os.path.join(currpath, + fname)) + if keypath and kploc[0]: + return None, None # Ambiguous... + if kploc[0]: + keypath, certpath = kploc + return keypath, certpath def create_certificate(keyout=None, certout=None):