[FIX] config.py: do not use appsdir to define the user's data dir when he has no home directory on unix
Force it to be '/var/lib/(appname)' in this case
This commit is contained in:
parent
f2598ecdce
commit
7e41903110
|
@ -62,9 +62,15 @@ DEFAULT_LOG_HANDLER = [':INFO']
|
||||||
|
|
||||||
def _get_default_datadir():
|
def _get_default_datadir():
|
||||||
home = os.path.expanduser('~')
|
home = os.path.expanduser('~')
|
||||||
func = appdirs.user_data_dir if os.path.exists(home) else appdirs.site_data_dir
|
if os.path.exists(home):
|
||||||
|
func = appdirs.user_data_dir
|
||||||
|
else:
|
||||||
|
if sys.platform in ['win32', 'darwin']:
|
||||||
|
func = appdirs.site_data_dir
|
||||||
|
else:
|
||||||
|
func = lambda **kwarg: "/var/lib/%s" % kwarg['appname']
|
||||||
# No "version" kwarg as session and filestore paths are shared against series
|
# No "version" kwarg as session and filestore paths are shared against series
|
||||||
return func(appname='Odoo', appauthor=release.author)
|
return func(appname='openerp', appauthor=release.author)
|
||||||
|
|
||||||
class configmanager(object):
|
class configmanager(object):
|
||||||
def __init__(self, fname=None):
|
def __init__(self, fname=None):
|
||||||
|
|
Loading…
Reference in New Issue