コード例 #1
0
    def server_wait(self):
        """
        This job just waits for the Delphix Engine to be up and for a
        succesful connection.

        No arguments
        """
        while True:
            try:
                system.get(self.server_session)
                break
            except:
                pass
            print_info("Waiting for Delphix Engine to be ready")
            sleep(3)
コード例 #2
0
    def server_wait(self):
        """
        This job just waits for the Delphix Engine to be up and for a 
        succesful connection.

        No arguments
        """
        while True:
            try:
                system.get(self.server_session)
                break
            except:    
                pass
            print_info("Waiting for Delphix Engine to be ready")
            sleep(3)
コード例 #3
0
    def job_mode(self, single_thread=True):
        """
        This method tells Delphix how to execute jobs, based on the
        single_thread variable

        single_thread: Execute application synchronously (True) or
                       async (False)
                       Default: True
        """

        # Synchronously (one at a time)
        if single_thread is True:
            print_debug("These jobs will be executed synchronously")
            return job_context.sync(self.server_session)

        # Or asynchronously
        elif single_thread is False:
            print_debug("These jobs will be executed asynchronously")
            # 5.3.5 changed the async method to asyncly, so we need to do a version check
            build_version = system.get(self.server_session).build_version
            if LooseVersion(
                "%s.%s.%s"
                % (build_version.major, build_version.minor, build_version.micro)
            ) < LooseVersion("5.3.5"):
                return job_context.asyncly(self.server_session)
            else:
                return job_context.asyncly(self.server_session)