Skip to content

Commit 442574b

Browse files
committed
Merge pull request cms-sw#2587 from ktf/get-das-queries
Misc updates -- Refactor InputInfo to easily get the list of DAS queries.
2 parents 8062bf4 + bfcf3e1 commit 442574b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Configuration/PyReleaseValidation/python/relval_steps.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,11 @@ def __init__(self,dataSet,label='',run=[],files=1000,events=InputInfoNDefault,sp
5151
self.ib_block = ib_block
5252

5353
def das(self, das_options):
54-
query_by = "block" if self.ib_block else "dataset"
55-
query_source = "{0}#{1}".format(self.dataSet, self.ib_block) if self.ib_block else self.dataSet
5654
if len(self.run) is not 0:
57-
command = ";".join(["das_client.py {3} --query 'file {0}={1} run={2}'".format(query_by, query_source, query_run, das_options) for query_run in self.run])
55+
command = ";".join(["das_client.py %s --query '%s'" % (das_options, query) for query in self.queries()])
5856
command = "({0})".format(command)
5957
else:
60-
command = "das_client.py {2} --query 'file {0}={1} site=T2_CH_CERN'".format(query_by, query_source, das_options)
58+
command = "das_client.py %s --query '%s'" % (das_options, self.queries()[0])
6159

6260
# Run filter on DAS output
6361
if self.ib_blacklist:
@@ -71,6 +69,14 @@ def lumiRanges(self):
7169
return "echo '{\n"+",".join(('"%d":[[1,268435455]]\n'%(x,) for x in self.run))+"}'"
7270
return None
7371

72+
def queries(self):
73+
query_by = "block" if self.ib_block else "dataset"
74+
query_source = "{0}#{1}".format(self.dataSet, self.ib_block) if self.ib_block else self.dataSet
75+
if len(self.run) is not 0:
76+
return ["file {0}={1} run={2}".format(query_by, query_source, query_run) for query_run in self.run]
77+
else:
78+
return ["file {0}={1} site=T2_CH_CERN".format(query_by, query_source)]
79+
7480
def __str__(self):
7581
if self.ib_block:
7682
return "input from: {0} with run {1}#{2}".format(self.dataSet, self.ib_block, self.run)

0 commit comments

Comments
 (0)