Commit dbc1449f authored by Hanno Schlichting's avatar Hanno Schlichting

Avoid a dependency on "App"

parent 5397ab2a
...@@ -354,11 +354,13 @@ def readUserAccessFile(filename): ...@@ -354,11 +354,13 @@ def readUserAccessFile(filename):
'''Reads an access file from the instance home. '''Reads an access file from the instance home.
Returns name, password, domains, remote_user_mode. Returns name, password, domains, remote_user_mode.
''' '''
# TODO dependencies environ = os.environ
import App.config instancehome = environ.get('INSTANCE_HOME', None)
cfg = App.config.getConfiguration() if not instancehome:
return None
try: try:
f = open(os.path.join(cfg.instancehome, filename), 'r') f = open(os.path.join(instancehome, filename), 'r')
line = f.readline() line = f.readline()
f.close() f.close()
except IOError: except IOError:
...@@ -367,8 +369,10 @@ def readUserAccessFile(filename): ...@@ -367,8 +369,10 @@ def readUserAccessFile(filename):
if line: if line:
data = line.strip().split(':') data = line.strip().split(':')
remote_user_mode = not data[1] remote_user_mode = not data[1]
try: ds = data[2].split(' ') try:
except: ds = [] ds = data[2].split(' ')
except:
ds = []
return data[0], data[1], ds, remote_user_mode return data[0], data[1], ds, remote_user_mode
else: else:
return None return None
......
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