Commit 71ee1c11 authored by Lorenz Steinert's avatar Lorenz Steinert

allow relpath in for share and path dir

parent 518d9387
......@@ -323,9 +323,13 @@ def get_share(rundir, config=None, sharedir=None):
logging.warning(sharedir + ': Not a Directory')
return Error.NO_DIR
elif config:
if os.path.isdir(config['PROTOKOLL']['share']):
config_share = config['PROTOKOLL']['share']
if os.path.isdir(config_share) and os.path.isabs(config_share):
return config['PROTOKOLL']['share']
logging.warning(config['PROTOKOLL']['share'] + ': Not a Directory')
elif os.path.isdir(os.path.join(rundir, '..', config_share)):
print(os.path.normpath(os.path.join(rundir, '..', config_share)))
return os.path.normpath(os.path.join(rundir, '..', config_share))
logging.warning(config_share + ': Not a Directory')
return Error.NO_DIR
elif os.path.isdir(os.path.join(rundir, '../share')):
return os.path.join(rundir, '../share')
......@@ -342,8 +346,12 @@ def get_path(rundir, config=None, path=None):
logging.warning(path + ': Not a Directory')
return Error.NO_DIR
elif config:
if os.path.isdir(config['PROTOKOLL']['path']):
return config['PROTOKOLL']['path']
config_path = config['PROTOKOLL']['path']
if os.path.isdir(config_path) and os.path.isabs(config_path):
return config_path
elif os.path.isdir(os.path.join(rundir, '..', config_path)):
print(os.path.normpath(os.path.join(rundir, '..', config_path)))
return os.path.normpath(os.path.join(rundir, '..', config_path))
logging.warning(config['PROTOKOLL']['path'] + ': Not a Directory')
return Error.NO_DIR
elif os.path.isdir(os.path.join(rundir, '../..')):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment