[sysadmin-bin] There might be Infrastructure repository being mirrored over to github (i.e extensions-web as per ma



commit a13d92107c541c3229caf11af1cae79292312b05
Author: Andrea Veri <averi redhat com>
Date:   Thu Feb 7 21:30:53 2019 +0100

    There might be Infrastructure repository being mirrored over to github (i.e extensions-web as per 
maintainer's request)

 deprecated_github_repos.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/deprecated_github_repos.py b/deprecated_github_repos.py
index ab9b9be..342f36b 100755
--- a/deprecated_github_repos.py
+++ b/deprecated_github_repos.py
@@ -20,13 +20,13 @@ else:
     print 'Make sure %s has a github/gitlab section and an oauth_token/rw_token key/value pair' % cfg_file
     sys.exit(1)
 
-def l_gitlab_repos():
+def l_gitlab_repos(group_id):
     import gitlab
     gitlab_projects = list()
 
     gl = gitlab.Gitlab('https://gitlab.gnome.org', gl_token, api_version=4)
 
-    group = gl.groups.get(8, with_projects=False)
+    group = gl.groups.get(int(group_id), with_projects=False)
     projects = group.projects.list(all=True)
 
     for project in projects:
@@ -82,9 +82,10 @@ def delete_repo(repo_name, url='https://api.github.com/repos/GNOME'):
     except HTTPError as e:
         print 'Error processing %s: %i' % (repo_name, e.code)
 
-gitlab_repos = l_gitlab_repos()
-github_repos = l_github_repos()
+gl_gnome_repos = l_gitlab_repos(8)
+gl_infra_repos = l_gitlab_repos(987)
+gh_repos = l_github_repos()
 
-for repo in github_repos:
-    if repo not in gitlab_repos:
+for repo in gh_repos:
+    if repo not in (gl_gnome_repos or gl_infra_repos):
         delete_repo(repo)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]