コード例 #1
0
    def run(self):
        """Ingition to the engine, this is what does the magic, and returns status of success or failure"""

        success = True
        l = Logger()

        l.log(Logger.info, "Starting the first pass...")

        # Run the first Pass
        pass1 = self._pass1()

        # Run the second pass if pass 1 passed and pass is not set to be skipped.
        if pass1 and not self._skipPass2:

            l.log(Logger.info, "Starting the second pass")
            success = self._pass2()

        else:

            success = pass1

        Logger().log(Logger.info, "Cleaning up systems")
        StaticHandler.cleanup()

        Logger().log(Logger.info, "Operations completed, check the dump directory for more information.")

        return success
コード例 #2
0
    def __init__(self, datadumpdirectory=None, indexgit=None, customindexfile=None, skippass2=False,
                 specificindexentries=None, testindexentries=None):
        """Initialize the engine, so it knows what to do."""

        # Initialze the engine
        StaticHandler.initialize(datadumpdirectory, indexgit, customindexfile)

        # Setup engine starte so its behavior is affected when it is started
        self._skipPass2 = skippass2
        self._specificIndexEntries = specificindexentries
        self._testIndexEntries = testindexentries

        return
コード例 #3
0
    def _clone_repo(self):
        """Function attempts to clone the git repo associated with the entry"""

        success = True

        if os.path.exists(self._gitCloneLocation):

            self._logger.log(Logger.info, "Git repo already exist, checking for updates...")
            self._update_branch()
            self._logger.log(Logger.success, "Changes if any, have been merged...")

        else:

            self._logger.log(Logger.info, "Attempting to clone repo...")
            cmd = ["git", "clone", self._gitURL, self._gitCloneLocation]

            if StaticHandler.execcmd(cmd):
                self._logger.log(Logger.success, "Cloning successful.")
                self._logger.log(Logger.info, "Checking out branch " + self._gitBranch + "...")
                self._update_branch()

            else:

                self._logger.log(Logger.error, "Failed to clone repo, skipping...")
                success = False

        self._testData["tests"]["clone"] = success
        return success
コード例 #4
0
    def _clone_repo(self):
        """Function attempts to clone the git repo associated with the entry"""

        success = True

        if os.path.exists(self._gitCloneLocation):

            self._logger.log(
                Logger.info, "Git repo already exist, checking for updates...")
            self._update_branch()
            self._logger.log(Logger.success,
                             "Changes if any, have been merged...")

        else:

            self._logger.log(Logger.info, "Attempting to clone repo...")
            cmd = ["git", "clone", self._gitURL, self._gitCloneLocation]

            if StaticHandler.execcmd(cmd):
                self._logger.log(Logger.success, "Cloning successful.")
                self._logger.log(
                    Logger.info,
                    "Checking out branch " + self._gitBranch + "...")
                self._update_branch()

            else:

                self._logger.log(Logger.error,
                                 "Failed to clone repo, skipping...")
                success = False

        self._testData["tests"]["clone"] = success
        return success
コード例 #5
0
    def __init__(self,
                 datadumpdirectory=None,
                 indexgit=None,
                 customindexfile=None,
                 skippass2=False,
                 specificindexentries=None,
                 testindexentries=None):
        """Initialize the engine, so it knows what to do."""

        # Initialze the engine
        StaticHandler.initialize(datadumpdirectory, indexgit, customindexfile)

        # Setup engine starte so its behavior is affected when it is started
        self._skipPass2 = skippass2
        self._specificIndexEntries = specificindexentries
        self._testIndexEntries = testindexentries

        return