diff --git a/statusd.py b/statusd.py index dc68d3c..53a324a 100755 --- a/statusd.py +++ b/statusd.py @@ -42,9 +42,13 @@ def read_config(CONFIGFILE, CONFIG): def certs_readable(config): - + ''' + checks at start, if the needed certificates defined (no nullstring) and readable. + param 1: dictionary + return: boolean + ''' for i in (config['SERVER_KEY'], config['SERVER_CERT'], config['CLIENT_CERT']): - if os.access(i, os.R_OK) == False: + if i == '' or os.access(i, os.R_OK) == False: logging.error('Cant read {}'.format(i)) return False return True