patronictl checks if --config value exists (#736) (#1092)

Be verbose about configuration file when the given filename does not exists instead of ignoring silently (which can lead to misunderstanding)
This commit is contained in:
wilfriedroset
2019-06-27 14:58:07 +02:00
committed by Alexander Kukushkin
parent 78999a2d62
commit 47c3dc2352
+4 -1
View File
@@ -69,7 +69,10 @@ def parse_dcs(dcs):
def load_config(path, dcs):
logging.debug('Loading configuration from file %s', path)
if not (os.path.exists(path) and os.access(path, os.R_OK)):
logging.debug('Ignoring configuration file "%s". It does not exists or is not readable.', path)
else:
logging.debug('Loading configuration from file %s', path)
config = {}
old_argv = list(sys.argv)
try: