diff --git a/jail2ban/auth.py b/jail2ban/auth.py index d9867bf..552c819 100644 --- a/jail2ban/auth.py +++ b/jail2ban/auth.py @@ -1,5 +1,4 @@ from flask import current_app, g -import os def get_users(): @@ -9,10 +8,10 @@ def get_users(): current_app.logger.debug('Reading %s for users', authfile) - with current_app.open_resource(os.path.join("..", - authfile)) as f: + with current_app.open_resource(authfile) as f: for entry in f: - users.update({tuple(entry.decode('ascii').strip().split(':', 1))}) + users.update({ + tuple(entry.decode('ascii').strip().split(':', 1))}) g.users = users current_app.logger.debug(g.users) return g.users diff --git a/tests/conftest.py b/tests/conftest.py index 2ebdf68..c4167b9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,7 +8,7 @@ def app(): app.config.update({ "TESTING": True, "SECRET_KEY": 'Testing', - "AUTHFILE": 'tests/users-test.txt' + "AUTHFILE": '../tests/users-test.txt' }) # other setup can go here