-
Notifications
You must be signed in to change notification settings - Fork 36
Conversation
jjnicola
commented
Apr 12, 2019
•
edited
Loading
edited
- Use enum for scan status.
- Update the test accordingly.
- Remove legacy_target string from the scan_info table.
- Fix progress calculation for legacy target mode.
- Check for scan status before trying to deleted.
Add new status init for the new scan still not launched. Update the test accordingly.
Codecov Report
@@ Coverage Diff @@
## master #101 +/- ##
==========================================
- Coverage 67.38% 67.37% -0.01%
==========================================
Files 8 8
Lines 1533 1548 +15
==========================================
+ Hits 1033 1043 +10
- Misses 500 505 +5
Continue to review full report at Codecov.
|
This improve target handling and make easier to work with legacy targets. Update tests accordingly.
Also fix an issue which finished target forced others scans to stop.
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.
Only one small mistake Dict instead of dict
ospd/misc.py
Outdated
""" Creates a new scan with provided scan information. """ | ||
|
||
if self.data_manager is None: | ||
self.data_manager = multiprocessing.Manager() | ||
if not options: | ||
options = Dict() |
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.
options = Dict() | |
options = dict() |
ospd/misc.py
Outdated
return self.scans_table[scan_id]['target_progress'] | ||
total_hosts = len(target_str_to_list(target)) | ||
host_progresses = self.scans_table[scan_id]['target_progress'].get(target) | ||
t_prog = sum(host_progresses.values()) / total_hosts |
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.
Could you check and ensure that total_hosts will never be zero?
ospd/misc.py
Outdated
@@ -202,14 +215,11 @@ def get_end_time(self, scan_id): | |||
|
|||
def get_target(self, scan_id): |
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.
Personally I would rename the method to get_targets
or get_target_list
.