Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Configuration/PyReleaseValidation/python/MatrixUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,8 @@ def genvalid(fragment,d,suffix='all',fi='',dataSet=''):
c['cfg']=fragment
return c


def check_dups(input):
seen = set()
dups = set(x for x in input if x in seen or seen.add(x))

return dups
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from copy import copy, deepcopy
from collections import OrderedDict
from .MatrixUtil import merge, Kby, Mby
from .MatrixUtil import merge, Kby, Mby, check_dups
import re

U2000by1={'--relval': '2000,1'}
Expand Down Expand Up @@ -2819,13 +2819,18 @@ def condition(self, fragment, stepList, key, hasHarvest):
offset = 0.9001,
)

# check for duplicate offsets
offsets = [specialWF.offset for specialType,specialWF in upgradeWFs.items()]
seen = set()
dups = set(x for x in offsets if x in seen or seen.add(x))
# check for duplicates in offsets or suffixes
offsets = [specialWF.offset for specialType,specialWF in upgradeWFs.items()]
suffixes = [specialWF.suffix for specialType,specialWF in upgradeWFs.items()]

dups = check_dups(offsets)
if len(dups)>0:
raise ValueError("Duplicate special workflow offsets not allowed: "+','.join([str(x) for x in dups]))

dups = check_dups(suffixes)
if len(dups)>0:
raise ValueError("Duplicate special workflow suffixes not allowed: "+','.join([str(x) for x in dups]))

upgradeProperties = {}

upgradeProperties[2017] = {
Expand Down