From e111336ba6d809ece05bb9c08e1085e2283a70c0 Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Mon, 7 Dec 2009 11:56:45 +0100 Subject: [PATCH] [IMP] Check if the config file exists (only if -c used, and not -s argument in the same time) bzr revid: christophe.chauvet@syleam.fr-20091207105645-9m8qclwrzfbo5cbh --- bin/tools/config.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/tools/config.py b/bin/tools/config.py index 2dd6b1131bf..4c6de0bba3c 100644 --- a/bin/tools/config.py +++ b/bin/tools/config.py @@ -202,6 +202,10 @@ class configmanager(object): die(opt.translate_out and (not opt.db_name), "the i18n-export option cannot be used without the database (-d) option") + # Check if the config file exists (only if -c used, and not -s argument) + die(not opt.save and opt.config and not os.path.exists(opt.config), + "The config file define with (-c) doesn't exists, use (-s) if you want to create it") + # place/search the config file on Win32 near the server installation # (../etc from the server) # if the server is run by an unprivileged user, he has to specify location of a config file where he has the rights to write,