From 4ec6d6633ebad5f7f5d714cc34ebdcdc0cc17758 Mon Sep 17 00:00:00 2001 From: Johnny Hughes Date: Jun 26 2017 15:26:57 +0000 Subject: update centos.git.repolist.py for git update, submitted by Pat Riehecky --- diff --git a/centos.git.repolist.py b/centos.git.repolist.py index 75122ae..e135ca7 100755 --- a/centos.git.repolist.py +++ b/centos.git.repolist.py @@ -13,7 +13,7 @@ import requests import simplejson as json import sys -RPCURL = "https://git.centos.org/rpc?req=LIST_REPOSITORIES" +RPCURL = "https://git.centos.org/rpc/?req=LIST_REPOSITORIES" def read_args(): ''' @@ -48,6 +48,11 @@ def get_repo_list(url, branch, projectpath): print err_msg sys.exit(1) + if req.status_code != 200: + print "Unable to access gitblit api at " + url + sys.exit(1) + + payload = req.text repos = json.loads(payload) branchname = 'refs/heads/' + branch @@ -68,6 +73,6 @@ def main(): repos = get_repo_list(url=options.url, branch=options.branch, projectpath=options.project) if repos: print '\n'.join(repos) - + if __name__ == "__main__": main()