(options, args) = parser.parse_args()

missing = []
mandatory = ["InputDataset", "CMSSWVersion", "Scenario", "GlobalTag"]
for option in options.__dict__:
    if getattr(options, option) is None and option in mandatory:
        missing.append(option)
if missing:
    print "Error: The following mandatory options are missing:"
    print "\n".join(missing)
    sys.exit(1) 

# The default arguments are set in:
#   WMCORE/src/python/WMCore/WMSpec/StdSpecs/Harvesting.py
arguments = getTestArguments()
arguments.update(options.__dict__)

connectToDB()

req_time = "%.2f" % time.time()
workloadName = "Harvesting%s--%s" % (arguments["InputDataset"].replace("/", "__"), req_time)
workloadFile = "Harvesting%s--%s.pkl" % (arguments["InputDataset"].replace("/", "__"), req_time)
os.mkdir(workloadName)
workload = harvestingWorkload(workloadName, arguments)
workloadPath = os.path.join(workloadName, workloadFile)
workload.setOwner("*****@*****.**")
workload.setSpecUrl(workloadPath)

# Build a sandbox using TaskMaker
taskMaker = TaskMaker(workload, os.path.join(os.getcwd(), workloadName))
Example #2
0
(options, args) = parser.parse_args()

missing = []
mandatory = ["InputDataset", "CMSSWVersion", "Scenario", "GlobalTag"]
for option in options.__dict__:
    if getattr(options, option) is None and option in mandatory:
        missing.append(option)
if missing:
    print "Error: The following mandatory options are missing:"
    print "\n".join(missing)
    sys.exit(1)

# The default arguments are set in:
#   WMCORE/src/python/WMCore/WMSpec/StdSpecs/Harvesting.py
arguments = getTestArguments()
arguments.update(options.__dict__)

connectToDB()

req_time = "%.2f" % time.time()
workloadName = "Harvesting%s--%s" % (arguments["InputDataset"].replace(
    "/", "__"), req_time)
workloadFile = "Harvesting%s--%s.pkl" % (arguments["InputDataset"].replace(
    "/", "__"), req_time)
os.mkdir(workloadName)
workload = harvestingWorkload(workloadName, arguments)
workloadPath = os.path.join(workloadName, workloadFile)
workload.setOwner("*****@*****.**")
workload.setSpecUrl(workloadPath)