From a73c02075afad47da4edae53659c14d71e1a303f Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 16 Jan 2014 11:02:43 +0100 Subject: [PATCH] [FIX] ensure data-dir (and subdirs) exists bzr revid: chs@openerp.com-20140116100243-ltp6yunvm1bnvn5q --- openerp/tools/config.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openerp/tools/config.py b/openerp/tools/config.py index 101724f4159..bd87a0d4b44 100644 --- a/openerp/tools/config.py +++ b/openerp/tools/config.py @@ -626,11 +626,17 @@ class configmanager(object): @property def addons_data_dir(self): - return os.path.join(self['data_dir'], 'addons', release.series) + d = os.path.join(self['data_dir'], 'addons', release.series) + if not os.path.exists(d): + os.makedirs(d) + return d @property def session_dir(self): - return os.path.join(self['data_dir'], 'sessions') + d = os.path.join(self['data_dir'], 'sessions') + if not os.path.exists(d): + os.makedirs(d) + return d config = configmanager()