From ec84501d7febe7c948b4dd0da9c1b9e762afff66 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 07 2017 14:04:05 +0000 Subject: Drop the new line character and the '# end of body' message when loading the config Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/git_auth.py b/pagure/lib/git_auth.py index b98d4ac..14384f2 100644 --- a/pagure/lib/git_auth.py +++ b/pagure/lib/git_auth.py @@ -283,7 +283,9 @@ class Gitolite2Auth(GitAuthHelper): """ _log.info('Reading in the current configuration: %s', configfile) with open(configfile) as stream: - current_config = [line for line in stream] + current_config = [line.rstrip() for line in stream] + if current_config and current_config[-1] == '# end of body': + current_config = current_config[:-1] if preconfig: idx = None