Commit 669e2c79 authored by ale's avatar ale

Catch errors when listing branches

For projects that do not have an associated repository.
parent 7b79c9d1
import logging
import re
......@@ -18,6 +19,7 @@ def list_projects(gl, search_pattern):
search_namespaces=True,
as_list=False,
simple=True,
archived=False,
)
for p in projects:
yield p.path_with_namespace
......@@ -26,7 +28,13 @@ def list_projects(gl, search_pattern):
def get_branches(gl, project_names):
for path_with_namespace in project_names:
p = gl.projects.get(path_with_namespace)
for b in p.branches.list():
try:
branches = p.branches.list()
except Exception as e:
logging.error('error getting branches for %s: %s',
path_with_namespace, e)
continue
for b in branches:
yield (path_with_namespace, b.name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment