Skip to content

Commit

Permalink
Merge pull request #757 from dynamic-entropy/master
Browse files Browse the repository at this point in the history
Update datatier regex to match with WMCore and DBS expressions
  • Loading branch information
dynamic-entropy authored Apr 3, 2024
2 parents 8b4deed + f9e2e11 commit df95868
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/policy/CMSRucioPolicy/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@
"pattern": "\\w"}

CMS_LFN_LENGTH = 500
CMS_DATASET_CORE = r'/[a-zA-Z0-9\-_]{1,99}/[a-zA-Z0-9\.\-_]{1,199}/[A-Z0-9\-]{1,50}'
CMS_DATASET_CORE = r'/[a-zA-Z0-9\-_]{1,99}/[a-zA-Z0-9\.\-_]{1,199}/[A-Z0-9\-]{1,99}'
CMS_BLOCK_PART = r'[a-zA-Z0-9\.\-_]{1,100}'

CMS_DATASET = r'^%s$' % CMS_DATASET_CORE
CMS_BLOCK = r'^%s#%s$' % (CMS_DATASET_CORE, CMS_BLOCK_PART) # Valid dataset name and block separated by #
CMS_LFN = r'^\/store\/[A-Za-z0-9][A-Za-z0-9\.\-\_\/]{1,%s}$' % (CMS_LFN_LENGTH - len('/store/'))

CMS_BLOCK_LENGTH = 100 + 200 + 51 + 101
CMS_BLOCK_LENGTH = 100 + 200 + 100 + 101 # dataset + # + block

NAME = {"description": "Data Identifier name",
"type": "string",
"pattern": r"%s|%s|%s" % (CMS_DATASET, CMS_BLOCK, CMS_LFN)}

NAME_LENGTH = max(CMS_LFN_LENGTH, CMS_BLOCK_LENGTH)
NAME_LENGTH = CMS_LFN_LENGTH

# read name
R_NAME = NAME
Expand Down

0 comments on commit df95868

Please sign in to comment.