Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataplane parser refactoring #1396

Merged
2 commits merged into from
Apr 4, 2019
Merged

Conversation

tomas321
Copy link
Contributor

Introduce feed field count checking before list elements access.

We have experienced IndexErrors with this parser, but couldn't locate the source of the problem regarding feed formats. These changes should be sufficient enough for tracing back the source and deals with IndexErrors.

Introduce feed field count checking before list elements access.

We have experienced IndexErrors with this parser, but couldn't locate the source of the problem regarding feed formats. These changes should be sufficient enough for tracing back the source and deals with IndexErrors.
@codecov-io
Copy link

codecov-io commented Mar 29, 2019

Codecov Report

Merging #1396 into develop will decrease coverage by 0.01%.
The diff coverage is 63.63%.

@@             Coverage Diff             @@
##           develop    #1396      +/-   ##
===========================================
- Coverage     76.5%   76.49%   -0.02%     
===========================================
  Files          312      312              
  Lines        14194    14195       +1     
  Branches      1882     1884       +2     
===========================================
- Hits         10859    10858       -1     
- Misses        2919     2920       +1     
- Partials       416      417       +1
Impacted Files Coverage Δ
intelmq/bots/parsers/dataplane/parser.py 82.6% <63.63%> (-8.31%) ⬇️

@Teebor-Choka
Copy link
Contributor

@wagner-certat, should you wish to add some more tests: the error messages in logs were generated by lines like these (example from the modified new bot on 2019-04-01: 'Incorrect format for feed http://dataplane.org/sshclient.txt, found line: "14080 | Telmex Colombia S.A., CO |"

Minor code refactor, move variable initialization outside the 'parse_line' function.
@Teebor-Choka Teebor-Choka force-pushed the dataplane_parser_fix branch from 023732b to 371b344 Compare April 2, 2019 08:32
@ghost ghost self-assigned this Apr 4, 2019
@ghost ghost self-requested a review April 4, 2019 13:29
@ghost ghost merged commit 371b344 into certtools:develop Apr 4, 2019
ghost pushed a commit that referenced this pull request Apr 4, 2019
changelog
test with broken entry
@ghost
Copy link

ghost commented Apr 4, 2019

Thanks, I added a test case for the broken line.

bddfaed

@Teebor-Choka Teebor-Choka deleted the dataplane_parser_fix branch April 4, 2019 20:37
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants