#!/usr/bin/env python

from WMComponent.DBS3Buffer.DBSBufferUtil  import DBSBufferUtil
from WMCore.WMInit import connectToDB
from pprint import pprint

if __name__ == "__main__":
    connectToDB()
    dbsUtil = DBSBufferUtil()
    result = dbsUtil.getPhEDExDBSStatusForCompletedWorkflows(summary=True)
    print("Completed workflows with dbs, phedex status")
    pprint(result)