Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libloc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
libloc
Commits
bbcefb38
Commit
bbcefb38
authored
Mar 05, 2022
by
Michael Tremer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
importer: Correctly hande response codes from Bird
Signed-off-by:
Michael Tremer
<
michael.tremer@ipfire.org
>
parent
098d871b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
src/python/location-importer.in
src/python/location-importer.in
+15
-3
No files found.
src/python/location-importer.in
View file @
bbcefb38
...
...
@@ -1109,6 +1109,8 @@ class CLI(object):
# Allocate some buffer
buffer
=
b""
log
.
debug
(
"Sending Bird command: %s"
%
command
)
# Send the command
s
.
send
(
b"%s
\
n
"
%
command
.
encode
())
...
...
@@ -1130,9 +1132,19 @@ class CLI(object):
# Split the line we want and keep the rest in buffer
line
,
buffer
=
buffer
[:
pos
],
buffer
[
pos
:]
# Look for the end-of-output indicator
if
line
==
b"0000
\
n
"
:
return
# Try parsing any status lines
if
len
(
line
)
>
4
and
line
[:
4
].
isdigit
()
and
line
[
4
]
in
(
32
,
45
):
code
,
delim
,
line
=
int
(
line
[:
4
]),
line
[
4
],
line
[
5
:]
log
.
debug
(
"Received response code %s from bird"
%
code
)
# End of output
if
code
==
0
:
return
# Ignore hello line
elif
code
==
1
:
continue
# Otherwise return the line
yield
line
...
...
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