diff options
author | Ralf Jung <post@ralfj.de> | 2015-02-22 21:23:26 +0100 |
---|---|---|
committer | Ralf Jung <post@ralfj.de> | 2015-02-22 21:23:26 +0100 |
commit | d82914054bb75574c2675649a943025e57fa8680 (patch) | |
tree | d46f5820336e117883d365030ff6314835b4bdf1 | |
parent | 6843793205d96449af070b5c7b776eaf205f5ad7 (diff) |
deal with the initial "zen" message from github; fix things
-rw-r--r-- | git_mirror.py | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | ssh-set-ident.sh | 0 | ||||
-rwxr-xr-x | webhook-core.py | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/git_mirror.py b/git_mirror.py index af963df..0bd4e81 100644 --- a/git_mirror.py +++ b/git_mirror.py @@ -111,10 +111,10 @@ class Repo: def setup_env(self): '''Setup the environment to work with this repository''' os.chdir(self.local) - ssh_set_ident = os.path.join(os.path.dirname(__file__), 'ssh-set-ident.conf') - os.setenv('GIT_SSH', ssh_set_ident) + ssh_set_ident = os.path.join(os.path.dirname(__file__), 'ssh-set-ident.sh') + os.putenv('GIT_SSH', ssh_set_ident) ssh_ident = os.path.join(os.path.expanduser('~/.ssh'), self.deploy_key) - os.setenv('SSH_IDENT', ssh_ident) + os.putenv('SSH_IDENT', ssh_ident) def update_mirrors(self, ref, oldsha, newsha, except_mirrors = [], suppress_stderr = False): '''Update the <ref> from <oldsha> to <newsha> on all mirrors. The update must already have happened locally.''' @@ -184,7 +184,7 @@ def load_repos(): global mail_sender conffile = os.path.join(os.path.dirname(__file__), 'git-mirror.conf') conf = read_config(conffile) - mail_sender = conf['mail-sender'] + mail_sender = conf['DEFAULT']['mail-sender'] repos = {} for name, section in conf.items(): diff --git a/ssh-set-ident.sh b/ssh-set-ident.sh index 58ba45e..58ba45e 100644..100755 --- a/ssh-set-ident.sh +++ b/ssh-set-ident.sh diff --git a/webhook-core.py b/webhook-core.py index bff1137..a9418bc 100755 --- a/webhook-core.py +++ b/webhook-core.py @@ -38,6 +38,12 @@ if __name__ == "__main__": # now sync this repository data = get_github_payload() + if 'zen' in data: + # github sends this initially + print("Content-Type: text/plain") + print() + print("Welcome!") + sys.exit(0) ref = data["ref"] oldsha = data["before"] newsha = data["after"] |