Esempio n. 1
0
def scan_launched(scanid, scan_request):
    try:
        log.debug("scanid: %s", scanid)
        scan_ctrl.set_launched(scanid, scan_request)
    except IrmaDatabaseError as e:
        log.exception(e)
        raise scan_launched.retry(countdown=2, max_retries=3, exc=e)
Esempio n. 2
0
def scan_launched(scanid, scan_request):
    try:
        log.debug("scanid: %s", scanid)
        scan_ctrl.set_launched(scanid, scan_request)
    except IrmaDatabaseError as e:
        log.exception(e)
        raise scan_launched.retry(countdown=2, max_retries=3, exc=e)
Esempio n. 3
0
 def test014_set_launched_status_not_uploaded(self):
     scan = MagicMock()
     scan.status = IrmaScanStatus.finished
     self.Scan.load_from_ext_id.return_value = scan
     module.set_launched("whatever", "whatever")
     self.assertEqual(scan.status, IrmaScanStatus.finished)
Esempio n. 4
0
 def test013_set_launched_status_uploaded(self):
     scan = MagicMock()
     scan.status = IrmaScanStatus.uploaded
     self.Scan.load_from_ext_id.return_value = scan
     module.set_launched("whatever", "whatever")
     scan.set_status.assert_called_with(IrmaScanStatus.launched)
Esempio n. 5
0
 def test014_set_launched_status_not_uploaded(self):
     scan = MagicMock()
     scan.status = IrmaScanStatus.finished
     self.Scan.load_from_ext_id.return_value = scan
     module.set_launched("whatever", "whatever")
     self.assertEqual(scan.status, IrmaScanStatus.finished)
Esempio n. 6
0
 def test013_set_launched_status_uploaded(self):
     scan = MagicMock()
     scan.status = IrmaScanStatus.uploaded
     self.Scan.load_from_ext_id.return_value = scan
     module.set_launched("whatever", "whatever")
     scan.set_status.assert_called_with(IrmaScanStatus.launched)
Esempio n. 7
0
def scan_launched(scanid):
    try:
        scan_ctrl.set_launched(scanid)
    except IrmaDatabaseError as e:
        print "Exception has occurred:{0}".format(e)
        raise scan_launched.retry(countdown=2, max_retries=3, exc=e)