summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-03-04 02:16:25 +0000
committerGerrit Code Review <review@openstack.org>2020-03-04 02:16:25 +0000
commite273b68325217a84225f8e979d5d77e65df2f626 (patch)
tree858153b8f06118268c9aa46229d4f9f78b8ddc3b
parent0f9dd4e8052753c472770ae5354032f36112d74d (diff)
parent4096dbdd1bf5c64776fe1ee7446f2d45019296e1 (diff)
downloadpython-jenkins-job-builder-e273b68325217a84225f8e979d5d77e65df2f626.tar.gz
python-jenkins-job-builder-e273b68325217a84225f8e979d5d77e65df2f626.tar.xz
python-jenkins-job-builder-e273b68325217a84225f8e979d5d77e65df2f626.zip
Merge "conditional-publisher: sort publisher attributes alphabetically"
-rwxr-xr-xjenkins_jobs/modules/publishers.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py
index 9205cde0..6c1de7ce 100755
--- a/jenkins_jobs/modules/publishers.py
+++ b/jenkins_jobs/modules/publishers.py
@@ -6547,6 +6547,12 @@ def conditional_publisher(registry, xml_parent, data):
for edited_node in create_publishers(registry, action):
if not use_publisher_list:
edited_node.set("class", edited_node.tag)
+ # sort attributes alphabetically
+ attrib = edited_node.attrib
+ if len(attrib) > 1:
+ attribs = sorted(attrib.items())
+ attrib.clear()
+ attrib.update(attribs)
edited_node.tag = "publisher"
parent.append(edited_node)