fix xml encoding issue #156
This commit is contained in:
@ -74,7 +74,7 @@ class qualysWhisperAPI(object):
|
|||||||
E.filters(
|
E.filters(
|
||||||
E.Criteria({'field': 'status', 'operator': 'EQUALS'}, status))))
|
E.Criteria({'field': 'status', 'operator': 'EQUALS'}, status))))
|
||||||
xml_output = self.qgc.request(self.COUNT_WASSCAN, parameters)
|
xml_output = self.qgc.request(self.COUNT_WASSCAN, parameters)
|
||||||
root = objectify.fromstring(xml_output)
|
root = objectify.fromstring(xml_output.encode('utf-8'))
|
||||||
return root.count.text
|
return root.count.text
|
||||||
|
|
||||||
def get_reports(self):
|
def get_reports(self):
|
||||||
@ -127,7 +127,9 @@ class qualysWhisperAPI(object):
|
|||||||
qualys_api_limit = limit
|
qualys_api_limit = limit
|
||||||
dataframes = []
|
dataframes = []
|
||||||
_records = []
|
_records = []
|
||||||
|
try:
|
||||||
total = int(self.get_was_scan_count(status=status))
|
total = int(self.get_was_scan_count(status=status))
|
||||||
|
self.logger.error('Already have WAS scan count')
|
||||||
self.logger.info('Retrieving information for {} scans'.format(total))
|
self.logger.info('Retrieving information for {} scans'.format(total))
|
||||||
for i in range(0, total):
|
for i in range(0, total):
|
||||||
if i % limit == 0:
|
if i % limit == 0:
|
||||||
@ -138,6 +140,8 @@ class qualysWhisperAPI(object):
|
|||||||
_records.append(scan_info)
|
_records.append(scan_info)
|
||||||
self.logger.debug('Converting XML to DataFrame')
|
self.logger.debug('Converting XML to DataFrame')
|
||||||
dataframes = [self.xml_parser(xml) for xml in _records]
|
dataframes = [self.xml_parser(xml) for xml in _records]
|
||||||
|
except Exception as e:
|
||||||
|
self.logger.error("Couldn't process all scans: {}".format(e))
|
||||||
|
|
||||||
return pd.concat(dataframes, axis=0).reset_index().drop('index', axis=1)
|
return pd.concat(dataframes, axis=0).reset_index().drop('index', axis=1)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user