Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sbws
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
juga
sbws
Commits
a4aa5e7d
Commit
a4aa5e7d
authored
6 years ago
by
juga
Browse files
Options
Downloads
Patches
Plain Diff
circuitbuilder: return reasons on circuit build errors
parent
0773f090
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sbws/lib/circuitbuilder.py
+2
-5
2 additions, 5 deletions
sbws/lib/circuitbuilder.py
with
2 additions
and
5 deletions
sbws/lib/circuitbuilder.py
+
2
−
5
View file @
a4aa5e7d
...
...
@@ -136,16 +136,13 @@ class GapsCircuitBuilder(CircuitBuilder):
return
None
,
"
Can not build a circuit, invalid path.
"
path
=
self
.
_normalize_path
(
path
)
if
path
is
None
:
return
None
return
None
,
"
Can not build a circuit, no path.
"
num_missing
=
len
([
'
foo
'
for
r
in
path
if
not
r
])
insert_relays
=
self
.
_random_sample_relays
(
num_missing
,
[
r
for
r
in
path
if
r
is
not
None
])
if
insert_relays
is
None
:
path
=
'
,
'
.
join
([
r
.
nickname
if
r
else
str
(
None
)
for
r
in
path
])
log
.
warning
(
'
Problem building a circuit to satisfy %s with available
'
'
relays in the network
'
,
path
)
return
None
return
None
,
"
Can not build a circuit with the current relays.
"
assert
len
(
insert_relays
)
==
num_missing
path
=
[
r
.
fingerprint
if
r
else
insert_relays
.
pop
().
fingerprint
for
r
in
path
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment