コード例 #1
0
def findPipelineReport(productsDir, ousUID):
    # DEMO ONLY: the "products" subdirectory should be looked for
    #            here we just take the hardcoded path
    ousUID = dbdrwutils.encode(ousUID)
    productsDir = os.path.join(productsDir, "SOUS", "GOUS", ousUID, "products")
    for file in os.listdir(productsDir):
        print(">>> PipelineDriver: file:", file)
        if (file.startswith("pl-report-") and file.endswith(".xml")):
            return (os.path.join(productsDir, file))
    raise RuntimeError("No pipeline report found in %s" % productsDir)
コード例 #2
0
    }
    retcode, ousStatuses = dbcon.find(dbName, selector)
    if retcode != 200:
        raise RuntimeError("find: %s: error %d: %s" % (dbName, retcode, OUSs))

    # For each OUS status entity we found, see if all data was actually replicated here
    if len(ousStatuses) > 0:
        startTime = time.time()  # Reset startTime for incremental waiting
        ousStatuses = sorted(ousStatuses, key=compareByTimestamp)
        for ous in ousStatuses:
            ousUID = ous['entityId']
            # ts = ous['timestamp']
            # print( ">>> found", ousUID, ts )

            # Retrieve the list of products from the delivery status
            encodedUID = dbdrwutils.encode(ousUID)
            dbName = 'delivery-status'
            retcode, delStatus = dbcon.findOne(dbName, encodedUID)
            if retcode != 200:
                raise RuntimeError("find: %s: error %d: %s" %
                                   (dbName, retcode, delStatus))

            # See if all those data products were replicated here
            dataProducts = delStatus['dataProducts']
            allReplicated = True
            for dataProduct in dataProducts:
                # print( ">>> found", dataProduct )
                if (not ngas.check(dataProduct)):
                    allReplicated = False
                    break