From 2f5f5583bec2a0a04424d6bedd763855f308bce6 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 3 Aug 2016 20:21:40 +0200 Subject: git-interface: Factor out configuration file parsing Add a new module that automatically locates the configuration file and provides methods to obtain the values of configuration options. Use the new module instead of ConfigParser everywhere. Signed-off-by: Lukas Fleischer --- git-interface/git-auth.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'git-interface/git-auth.py') diff --git a/git-interface/git-auth.py b/git-interface/git-auth.py index 7cd033c..ebdc75c 100755 --- a/git-interface/git-auth.py +++ b/git-interface/git-auth.py @@ -1,11 +1,10 @@ #!/usr/bin/python3 -import configparser import shlex -import os import re import sys +import config import db @@ -24,9 +23,6 @@ def format_command(env_vars, command, ssh_opts, ssh_key): return msg -config = configparser.RawConfigParser() -config.read(os.path.dirname(os.path.realpath(__file__)) + "/../conf/config") - valid_keytypes = config.get('auth', 'valid-keytypes').split() username_regex = config.get('auth', 'username-regex') git_serve_cmd = config.get('auth', 'git-serve-cmd') -- cgit v1.2.3-54-g00ecf