Skip to content

Commit

Permalink
validation work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ticoann committed Jul 23, 2013
1 parent e010744 commit 6518f43
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/python/WMCore/WMSpec/WMWorkload.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,44 @@ def locationDataSourceFlag(self):
for task in self.getTopLevelTask():
return task.inputLocationFlag()
return False

def setAssignmentArgs(self, args):
"""
set up all the argument related to assigning request.
args are validated before update.
assignment is common for all different types spec.
"""

processedDatasetParts = ["AcquisitionEra", "ProcessingVersion"]
if args.get("ProcessingString", None):
processedDatasetParts.append("ProcessingString")
for field in processedDatasetParts:
if type(args[field]) == dict:
for value in args[field].values():
self.validate(value, field)
else:
self.validate(args[field], field)

# Set white list and black list
whiteList = args.get("SiteWhitelist", [])
blackList = args.get("SiteBlacklist", [])
self.setSiteWildcardsLists(siteWhitelist = whiteList, siteBlacklist = blackList,
wildcardDict = self.wildcardSites)
# Set ProcessingVersion and AcquisitionEra, which could be json encoded dicts
self.setProcessingVersion(args["ProcessingVersion"])
self.setAcquisitionEra(args["AcquisitionEra"])
self.setProcessingString(args.get("ProcessingString", None))
#FIXME not validated
self.setLFNBase(args["MergedLFNBase"], args["UnmergedLFNBase"])
self.setMergeParameters(int(args.get("MinMergeSize", 2147483648)),
int(args.get("MaxMergeSize", 4294967296)),
int(args.get("MaxMergeEvents", 50000)))
self.setupPerformanceMonitoring(int(args.get("maxRSS", 2411724)),
int(args.get("maxVSize", 20411724)),
int(args.get("SoftTimeout", 129600)),
int(args.get("GracePeriod", 300)))

return args

class WMWorkload(ConfigSection):
"""
Expand Down

0 comments on commit 6518f43

Please sign in to comment.