Re-order some XML attributes, to preserve ordering

Python 3.8 changed things, so now the order of the attributes is not
alphabetic anymore but reflect the order they where added.
See this CPython commit for more details:
6367391646

This lets the testsuite pass with both CPython 3.8 as well as previous
versions.

Change-Id: I315abda0465d882d9673c9a7faac0990e38b6840
Signed-off-by: Mattia Rizzolo <mattia@mapreri.org>
This commit is contained in:
Mattia Rizzolo 2020-01-31 19:04:18 +01:00 committed by Mattia Rizzolo
parent 29b8795753
commit dc83d5161f
No known key found for this signature in database
GPG Key ID: 0816B9E18C762BAD
3 changed files with 7 additions and 7 deletions

View File

@ -93,8 +93,8 @@ class Pipeline(jenkins_jobs.modules.base.Base):
xml_parent,
"definition",
{
"plugin": "workflow-cps",
"class": "org.jenkinsci.plugins." "workflow.cps.CpsFlowDefinition",
"plugin": "workflow-cps",
},
)
XML.SubElement(xml_definition, "script").text = data["dsl"]
@ -103,9 +103,9 @@ class Pipeline(jenkins_jobs.modules.base.Base):
xml_parent,
"definition",
{
"plugin": "workflow-cps",
"class": "org.jenkinsci.plugins.workflow.cps."
"CpsScmFlowDefinition",
"plugin": "workflow-cps",
},
)
else:

View File

@ -66,8 +66,8 @@ class Workflow(jenkins_jobs.modules.base.Base):
xml_parent,
"definition",
{
"plugin": "workflow-cps",
"class": "org.jenkinsci.plugins." "workflow.cps.CpsFlowDefinition",
"plugin": "workflow-cps",
},
)

View File

@ -1003,7 +1003,7 @@ def rbenv(registry, xml_parent, data):
ro_class = "Jenkins::Tasks::BuildWrapperProxy"
ro = XML.SubElement(
rpo, "ruby-object", {"ruby-class": ro_class, "pluginid": "rbenv"}
rpo, "ruby-object", {"pluginid": "rbenv", "ruby-class": ro_class}
)
XML.SubElement(
@ -1011,7 +1011,7 @@ def rbenv(registry, xml_parent, data):
).text = "rbenv"
o = XML.SubElement(
ro, "object", {"ruby-class": "RbenvWrapper", "pluginid": "rbenv"}
ro, "object", {"pluginid": "rbenv", "ruby-class": "RbenvWrapper"}
)
mapping = [
@ -1033,8 +1033,8 @@ def rbenv(registry, xml_parent, data):
for elem in mapping:
(optname, xmlname, val) = elem[:3]
elem_tag = o.find(xmlname)
elem_tag.set("ruby-class", "String")
elem_tag.set("pluginid", "rbenv")
elem_tag.set("ruby-class", "String")
ignore_local_class = "FalseClass"
@ -1046,7 +1046,7 @@ def rbenv(registry, xml_parent, data):
XML.SubElement(
o,
"ignore__local__version",
{"ruby-class": ignore_local_class, "pluginid": "rbenv"},
{"pluginid": "rbenv", "ruby-class": ignore_local_class},
)