don't fail if no scans are found
This commit is contained in:
@ -29,6 +29,8 @@ class qualysWhisperAPI(object):
|
||||
def scan_xml_parser(self, xml):
|
||||
all_records = []
|
||||
root = ET.XML(xml.encode('utf-8'))
|
||||
if not root.find('.//SCAN_LIST'):
|
||||
return pd.DataFrame(columns=['id', 'status'])
|
||||
for child in root.find('.//SCAN_LIST'):
|
||||
all_records.append({
|
||||
'name': child.find('TITLE').text,
|
||||
|
@ -120,6 +120,8 @@ class qualysWhisperAPI(object):
|
||||
_records.append(scan_info)
|
||||
self.logger.debug('Converting XML to DataFrame')
|
||||
dataframes = [self.xml_parser(xml) for xml in _records]
|
||||
if not dataframes:
|
||||
return pd.DataFrame(columns=['id'])
|
||||
except Exception as e:
|
||||
self.logger.error("Couldn't process all scans: {}".format(e))
|
||||
|
||||
|
Reference in New Issue
Block a user