Changeset 3865

Show
Ignore:
Timestamp:
12/25/08 19:35:02 (4 years ago)
Author:
gpolo
Message:

Always remove a finished scan from the running scans list

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branch/NetworkInventory/umitInventory/InventoryTree.py

    r3670 r3865  
    2424import gtk 
    2525import gobject 
     26import traceback 
    2627from ConfigParser import ConfigParser, NoSectionError 
    2728 
     
    292293 
    293294            if not scan_state: # scan finished 
    294                 XMLStore(Path.umitdb_ng, scan.get_xml_output_file(), 
    295                          inventory=inventory) 
    296                 scan.close() 
    297                 todelete.append(scan) 
     295                try: 
     296                    XMLStore(Path.umitdb_ng, scan.get_xml_output_file(), 
     297                             inventory=inventory) 
     298                except Exception: 
     299                    # failed while adding scan to the database 
     300                    dlg = GenericAlert(_("Database couldn't be updated!"), 
     301                            _("The scan for the Inventory %r finished but " 
     302                                "its results couldn't be added to the " 
     303                                "database.\n\n%s" % (inventory, 
     304                                    traceback.format_exc())), 
     305                                buttons={1: (gtk.RESPONSE_OK, gtk.STOCK_OK)}) 
     306                    dlg.run() 
     307                    dlg.destroy() 
     308                finally: 
     309                    scan.close() 
     310                    todelete.append(scan) 
    298311 
    299312        for td in todelete: # remove finished scans from running_scans