don't fail if no scans are found

This commit is contained in:
pemontto
2019-05-10 11:31:38 +01:00
parent 3ce6065b38
commit a432491e7e
2 changed files with 4 additions and 0 deletions

View File

@ -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,