示例#1
0
def arc_get_output(jid, directory):
    """ARC CE job output retrieval"""

    if not __cream_ui_check__():
        return (False, None)

    # construct URI list from ID and output from arcls
    cmd = 'arcls %s %s' % (__arc_get_config_file_arg__(), jid)
    exec_bin = True
    logger.debug('arcls command: %s' % cmd)
    rc, output, m = getShell().cmd1(
        '%s%s' % (__get_cmd_prefix_hack__(binary=exec_bin), cmd),
        allowed_exit=[0, 255],
        timeout=config['SubmissionTimeout'])
    if rc:
        logger.error(
            "Could not find directory associated with ARC job ID '%s'" % jid)
        return False

    # URI is JID + filename
    gfiles = []
    for uri in output.split("\n"):
        if len(uri) == 0:
            continue
        uri = jid + "/" + uri
        gf = GridftpFileIndex()
        gf.id = uri
        gfiles.append(gf)

    cache = GridftpSandboxCache()
    cache.vo = config['VirtualOrganisation']
    cache.uploaded_files = gfiles
    return cache.download(files=map(lambda x: x.id, gfiles),
                          dest_dir=directory)
示例#2
0
def arc_get_output(jid, directory):
    """ARC CE job output retrieval"""

    if not __cream_ui_check__():
        return (False, None)

    # construct URI list from ID and output from arcls
    cmd = "arcls %s %s" % (__arc_get_config_file_arg__(), jid)
    exec_bin = True
    logger.debug("arcls command: %s" % cmd)
    rc, output, m = getShell().cmd1(
        "%s%s" % (__get_cmd_prefix_hack__(binary=exec_bin), cmd),
        allowed_exit=[0, 255],
        timeout=config["SubmissionTimeout"],
    )
    if rc:
        logger.error("Could not find directory associated with ARC job ID '%s'" % jid)
        return False

    # URI is JID + filename
    gfiles = []
    for uri in output.split("\n"):
        if len(uri) == 0:
            continue
        uri = jid + "/" + uri
        gf = GridftpFileIndex()
        gf.id = uri
        gfiles.append(gf)

    cache = GridftpSandboxCache()
    cache.vo = config["VirtualOrganisation"]
    cache.uploaded_files = gfiles
    return cache.download(files=map(lambda x: x.id, gfiles), dest_dir=directory)
示例#3
0
def cream_get_output(osbURIList, directory):
    """CREAM CE job output retrieval"""

    if not __cream_ui_check__():
        return False, None

    gfiles = []
    for uri in osbURIList:
        gf = GridftpFileIndex()
        gf.id = uri
        gfiles.append(gf)

    cache = GridftpSandboxCache()
    cache.vo = config["VirtualOrganisation"]
    cache.uploaded_files = gfiles

    return cache.download(files=map(lambda x: x.id, gfiles), dest_dir=directory)
示例#4
0
def cream_get_output(osbURIList, directory):
    """CREAM CE job output retrieval"""

    if not __cream_ui_check__():
        return False, None

    gfiles = []
    for uri in osbURIList:
        gf = GridftpFileIndex()
        gf.id = uri
        gfiles.append(gf)

    cache = GridftpSandboxCache()
    cache.vo = config['VirtualOrganisation']
    cache.uploaded_files = gfiles

    return cache.download(files=map(lambda x: x.id, gfiles),
                          dest_dir=directory)
示例#5
0
文件: Grid.py 项目: wvengen/lgipilot
    def cream_get_output(self, osbURIList, directory):
        '''CREAM CE job output retrieval'''

        if not self.__cream_ui_check__():
            return (False,None)

        gfiles = []
        for uri in osbURIList:
            gf = GridftpFileIndex()
            gf.id = uri
            gfiles.append(gf)

        cache = GridftpSandboxCache()
        cache.middleware = 'GLITE'
        cache.vo = self.config['VirtualOrganisation']
        cache.uploaded_files = gfiles

        return cache.download( files=map(lambda x:x.id, gfiles), dest_dir=directory )