Пример #1
0
    def _get_scan_progress_xml(self, scan_id: str):
        """ Gets scan_id scan's progress in XML format.

        @return: String of scan progress in xml.
        """
        current_progress = dict()

        current_progress[
            'current_hosts'
        ] = self.scan_collection.get_current_target_progress(scan_id)
        current_progress['overall'] = self.get_scan_progress(scan_id)
        current_progress['count_alive'] = self.scan_collection.get_count_alive(
            scan_id
        )
        current_progress['count_dead'] = self.scan_collection.get_count_dead(
            scan_id
        )
        current_progress[
            'count_excluded'
        ] = self.scan_collection.simplify_exclude_host_count(scan_id)
        current_progress['count_total'] = self.scan_collection.get_host_count(
            scan_id
        )

        return get_progress_xml(current_progress)
Пример #2
0
    def _get_scan_progress_xml(self, scan_id: str):
        """Gets scan_id scan's progress in XML format.

        Returns:
            String of scan progress in xml.
        """
        current_progress = self._get_scan_progress_raw(scan_id)
        return get_progress_xml(current_progress)