Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
silver-platter
gitlab-deps
Commits
669e2c79
Commit
669e2c79
authored
Aug 22, 2020
by
ale
Browse files
Catch errors when listing branches
For projects that do not have an associated repository.
parent
7b79c9d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
gitlab_deps/deps.py
View file @
669e2c79
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment