Merge lp:~syleam/openobject-server/trunk-check-config-exists into lp:openobject-server

Proposed by Christophe CHAUVET
Status: Merged
Merged at revision: 2022
Proposed branch: lp:~syleam/openobject-server/trunk-check-config-exists
Merge into: lp:openobject-server
Diff against target: 14 lines (+4/-0)
1 file modified
bin/tools/config.py (+4/-0)
To merge this branch: bzr merge lp:~syleam/openobject-server/trunk-check-config-exists
Reviewer Review Type Date Requested Status
Xavier (Open ERP) (community) Approve
Review via email: mp+15744@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

Check if the file relate by -c argument exists (don't verify if (-s) is present)

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) :
review: Approve
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Merged, forgetful minds thank you.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/tools/config.py'
2--- bin/tools/config.py 2009-11-24 14:44:05 +0000
3+++ bin/tools/config.py 2009-12-07 11:10:29 +0000
4@@ -202,6 +202,10 @@
5 die(opt.translate_out and (not opt.db_name),
6 "the i18n-export option cannot be used without the database (-d) option")
7
8+ # Check if the config file exists (only if -c used, and not -s argument)
9+ die(not opt.save and opt.config and not os.path.exists(opt.config),
10+ "The config file define with (-c) doesn't exists, use (-s) if you want to create it")
11+
12 # place/search the config file on Win32 near the server installation
13 # (../etc from the server)
14 # 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,