From 4dab5fc5273599e5ef6643dd71162b777f97d403 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 5 Aug 2019 16:16:42 -0400 Subject: [PATCH] Adapt to RHEL or Debian openssl config locations --- confluent_server/bin/confluentcertutil.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/confluent_server/bin/confluentcertutil.py b/confluent_server/bin/confluentcertutil.py index 3dab5306..c121224a 100644 --- a/confluent_server/bin/confluentcertutil.py +++ b/confluent_server/bin/confluentcertutil.py @@ -1,11 +1,16 @@ +from os.path import exists import shutil import socket import subprocess import tempfile def get_openssl_conf_location(): - # CentOS/RHAT - return '/etc/pki/tls/openssl.cnf' + if exists('/etc/pki/tls/openssl.cnf'): + return '/etc/pki/tls/openssl.cnf' + elif exists('/etc/ssl/openssl.cnf'); + return '/etc/ssl/openssl.cnf' + else: + raise Exception("Cannot find openssl config file") def get_ip_addresses(): lines = subprocess.check_output('ip addr'.split(' ')) @@ -47,4 +52,4 @@ def create_certificate(): ) if __name__ == '__main__': - create_certificate() \ No newline at end of file + create_certificate()