-
Notifications
You must be signed in to change notification settings - Fork 58
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
Conversation
Avoid ospd to crash if there is an invalid char.
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this 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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
d27ebea
to
41019ed
Compare
Refactor stream handling
Avoid ospd to crash if there is an invalid char.