Beispiel #1
0
    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()
Beispiel #2
0
    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()
Beispiel #3
0
            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
Beispiel #4
0
            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