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)
Exemple #2
0
def job_mode(server):
    """
    This function tells Delphix how to execute jobs, based on the
    single_thread variable at the beginning of the file
    """
    # Synchronously (one at a time)
    if single_thread == True:
        job_m = job_context.sync(server)
        print_debug("These jobs will be executed synchronously")
    # Or asynchronously
    else:
        job_m = job_context. async (server)
        print_debug("These jobs will be executed asynchronously")
    return job_m
def job_mode(server):
    """
    This function tells Delphix how to execute jobs, based on the 
    single_thread variable at the beginning of the file
    """
    #Synchronously (one at a time)
    if single_thread == True:
        job_m = job_context.sync(server)
        print_debug("These jobs will be executed synchronously")
    #Or asynchronously
    else:
        job_m = job_context.async(server)
        print_debug("These jobs will be executed asynchronously")
    return job_m
    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")
            return job_context.async(self.server_session)