Views require case insensitive sorting

Regular sorting places capital letters before lowercase, that is
incorrect order for Jenkins and causes jobs with names starting with
capital letters to become invisible in generated views

Change-Id: I2431d4fd5b86ce7ed6393b7d89552d08f025a5b9
Task: 12611
Story: 2001844
This commit is contained in:
Aigars Mahinovs 2018-08-10 13:38:51 +02:00 committed by Aigars Mahinovs
parent b23394b47b
commit 2bec965c2f
3 changed files with 4 additions and 1 deletions

View File

@ -324,7 +324,8 @@ class List(jenkins_jobs.modules.base.Base):
} }
) )
if jobnames is not None: if jobnames is not None:
jobnames = sorted(jobnames) # Job names must be sorted in the xml # Job names must be sorted in the xml
jobnames = sorted(jobnames, key=str.lower)
for jobname in jobnames: for jobname in jobnames:
XML.SubElement(jn_xml, 'string').text = str(jobname) XML.SubElement(jn_xml, 'string').text = str(jobname)

View File

@ -10,6 +10,7 @@
<string>job-name-1</string> <string>job-name-1</string>
<string>job-name-2</string> <string>job-name-2</string>
<string>job-name-3</string> <string>job-name-3</string>
<string>Job-name-4</string>
</jobNames> </jobNames>
<jobFilters/> <jobFilters/>
<columns> <columns>

View File

@ -7,6 +7,7 @@ job-name:
- job-name-1 - job-name-1
- job-name-3 - job-name-3
- job-name-2 - job-name-2
- Job-name-4
columns: columns:
- status - status
- weather - weather