def endScript(self): # After running script, wait for stuff try: tools.waitForTasks() except Exception: pass try: tools.unlinkFiles() except Exception: pass try: tools.execBeforeExit() except Exception: pass self.closeWindow()
if tools.verifySignature(script, signature) is False: logger.error('Signature is invalid') raise Exception( 'Invalid UDS code signature. Please, report to administrator' ) logger.debug('Script: %s', script) six.exec_(script, globals(), {'parent': None, 'sp': params}) except Exception as e: error = 'ERROR: {}'.format(e) logger.error(error) ui.message('Error', error) sys.exit(2) # Finalize try: tools.waitForTasks() except Exception: pass try: tools.unlinkFiles() except Exception: pass try: tools.execBeforeExit() except Exception: pass
sys.exit(1) res = getWithRetry(rest, '/{}/{}'.format(ticket, scrambler), params={'hostname': tools.getHostName(), 'version': VERSION}) script = res.decode('base64').decode('bz2') logger.debug('Script: {}'.format(script)) six.exec_(script, globals(), {'parent': None}) except Exception as e: error = 'ERROR: {}'.format(e) logger.error(error) ui.message('Error', error) sys.exit(2) # Finalize try: tools.waitForTasks() except Exception: pass try: tools.unlinkFiles() except Exception: pass try: tools.execBeforeExit() except Exception: pass