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

[1.0] Improve error handling when creating vts xml elements. #139

Merged
merged 4 commits into from
Nov 4, 2019

Conversation

jjnicola
Copy link
Member

Avoid ospd to crash if there is an invalid char.

Avoid ospd to crash if there is an invalid char.
@codecov
Copy link

codecov bot commented Oct 30, 2019

Codecov Report

Merging #139 into ospd-openvas-1.0 will increase coverage by 1.7%.
The diff coverage is 92.15%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           ospd-openvas-1.0     #139     +/-   ##
===================================================
+ Coverage             69.83%   71.54%   +1.7%     
===================================================
  Files                     4        4             
  Lines                   935      963     +28     
===================================================
+ Hits                    653      689     +36     
+ Misses                  282      274      -8
Impacted Files Coverage Δ
ospd_openvas/daemon.py 60.08% <92.15%> (+3.01%) ⬆️
ospd_openvas/db.py 98.96% <0%> (-0.01%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f299cc9...41019ed. Read the comment docs.

Copy link
Contributor

@mattmundell mattmundell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK to me, but does it need the same changes that Codacity is catching on master?

@@ -1017,11 +1082,9 @@ def stop_scan_cleanup(
self.openvas_db.release_db(current_kbi)
for host_kb in range(0, self.openvas_db.max_dbindex):
self.openvas_db.select_kb(
ctx,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These formatting changes would have been better in a separate commit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not realize about this since it is done automatically when I commit. There is a hook which runs black.

@@ -626,7 +626,7 @@ def get_dependencies_vt_as_xml_str(
_vt_dep = Element('dependency')
try:
_vt_dep.set('vt_id', dep)
except TypeError:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to be about improving the tests.

Copy link
Member Author

@jjnicola jjnicola Nov 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. This improves the error handling, not the test. But it is related to the first commit. I should have done this with the first commit or in a separated one.

@jjnicola jjnicola merged commit 2e3498d into greenbone:ospd-openvas-1.0 Nov 4, 2019
@jjnicola jjnicola deleted the try-xml-text-1 branch November 4, 2019 13:43
ArnoStiefvater pushed a commit to ArnoStiefvater/ospd-openvas that referenced this pull request Oct 25, 2021
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