2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-13 17:19:29 +00:00

Adapt to RHEL or Debian openssl config locations

This commit is contained in:
Jarrod Johnson 2019-08-05 16:16:42 -04:00
parent 8897842fc4
commit 4dab5fc527

View File

@ -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()
create_certificate()