summaryrefslogtreecommitdiff
path: root/git-interface/git-auth.py
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-08-03 20:21:40 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-08-05 12:05:22 +0200
commit2f5f5583bec2a0a04424d6bedd763855f308bce6 (patch)
tree11728e9e0405899f1aab60af5daec7aa3e99a0c7 /git-interface/git-auth.py
parent2915abb9d35308150ec107c5f4664e116daaf1de (diff)
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 <lfleischer@archlinux.org>
Diffstat (limited to 'git-interface/git-auth.py')
-rwxr-xr-xgit-interface/git-auth.py6
1 files changed, 1 insertions, 5 deletions
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')