summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2017-01-28 00:46:46 +0100
committerOlivier Dony <odo@openerp.com>2017-01-28 01:53:54 +0100
commitb0c2adbccbe0a3536d8a0509e98c977f50add6bd (patch)
tree76e4c9985b6044db297f4b53fd7c3bda2b236b9a
parentdff352acdb8b15b59bb4257814e62c4e46798739 (diff)
[FIX] config: correctly bootstrap data_dir
Complements the patch in 4715d18e122554972ca9d20ce3d361dcbc0e646c in order to properly bootstrap a writeable data_dir when it is (partially) nonexistant. Depending on the startup parameters the data_dir might otherwise have ended up read-only, preventing the creation of its necessary components (session store, file store). Only the `addons` directory of the data_dir needs to be read-only by default.
-rw-r--r--openerp/tools/config.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/openerp/tools/config.py b/openerp/tools/config.py
index 0421abaf8e4..d1cbc306d88 100644
--- a/openerp/tools/config.py
+++ b/openerp/tools/config.py
@@ -560,9 +560,13 @@ class configmanager(object):
@property
def addons_data_dir(self):
- d = os.path.join(self['data_dir'], 'addons', release.series)
+ add_dir = os.path.join(self['data_dir'], 'addons')
+ d = os.path.join(add_dir, release.series)
if not os.path.exists(d):
try:
+ # bootstrap parent dir +rwx
+ if not os.path.exists(add_dir):
+ os.makedirs(add_dir, 0700)
# try to make +rx placeholder dir, will need manual +w to activate it
os.makedirs(d, 0500)
except OSError: