Skip to content

Commit 5b93e63

Browse files
authored
Merge pull request #45715 from AdrianoDee/duplicate_suffixes
Having Upgrade Matrix Failing for Duplicate Suffixes
2 parents 87db105 + 18c29a6 commit 5b93e63

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

Configuration/PyReleaseValidation/python/MatrixUtil.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,8 @@ def genvalid(fragment,d,suffix='all',fi='',dataSet=''):
266266
c['cfg']=fragment
267267
return c
268268

269-
269+
def check_dups(input):
270+
seen = set()
271+
dups = set(x for x in input if x in seen or seen.add(x))
272+
273+
return dups

Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from copy import copy, deepcopy
22
from collections import OrderedDict
3-
from .MatrixUtil import merge, Kby, Mby
3+
from .MatrixUtil import merge, Kby, Mby, check_dups
44
import re
55

66
U2000by1={'--relval': '2000,1'}
@@ -2821,13 +2821,18 @@ def condition(self, fragment, stepList, key, hasHarvest):
28212821
offset = 0.9001,
28222822
)
28232823

2824-
# check for duplicate offsets
2825-
offsets = [specialWF.offset for specialType,specialWF in upgradeWFs.items()]
2826-
seen = set()
2827-
dups = set(x for x in offsets if x in seen or seen.add(x))
2824+
# check for duplicates in offsets or suffixes
2825+
offsets = [specialWF.offset for specialType,specialWF in upgradeWFs.items()]
2826+
suffixes = [specialWF.suffix for specialType,specialWF in upgradeWFs.items()]
2827+
2828+
dups = check_dups(offsets)
28282829
if len(dups)>0:
28292830
raise ValueError("Duplicate special workflow offsets not allowed: "+','.join([str(x) for x in dups]))
28302831

2832+
dups = check_dups(suffixes)
2833+
if len(dups)>0:
2834+
raise ValueError("Duplicate special workflow suffixes not allowed: "+','.join([str(x) for x in dups]))
2835+
28312836
upgradeProperties = {}
28322837

28332838
upgradeProperties[2017] = {

0 commit comments

Comments
 (0)