summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2020-01-31 19:04:18 +0100
committerMattia Rizzolo <mattia@debian.org>2020-02-02 00:18:13 +0100
commitdc83d5161fd58c22018c0355282f98c9c2369035 (patch)
tree33e7e8afd12a456389785b224291f5cd88f20d9d
parent29b87957539b34313778f6d31a922ccf53645aac (diff)
downloadpython-jenkins-job-builder-dc83d5161fd58c22018c0355282f98c9c2369035.tar.gz
python-jenkins-job-builder-dc83d5161fd58c22018c0355282f98c9c2369035.tar.xz
python-jenkins-job-builder-dc83d5161fd58c22018c0355282f98c9c2369035.zip
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: https://github.com/python/cpython/commit/63673916464bace8e2147357395fdf3497967ecb 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>
-rw-r--r--jenkins_jobs/modules/project_pipeline.py4
-rw-r--r--jenkins_jobs/modules/project_workflow.py2
-rw-r--r--jenkins_jobs/modules/wrappers.py8
3 files changed, 7 insertions, 7 deletions
diff --git a/jenkins_jobs/modules/project_pipeline.py b/jenkins_jobs/modules/project_pipeline.py
index 518ba2c9..15c39cb4 100644
--- a/jenkins_jobs/modules/project_pipeline.py
+++ b/jenkins_jobs/modules/project_pipeline.py
@@ -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:
diff --git a/jenkins_jobs/modules/project_workflow.py b/jenkins_jobs/modules/project_workflow.py
index 35cd93b5..994e89c8 100644
--- a/jenkins_jobs/modules/project_workflow.py
+++ b/jenkins_jobs/modules/project_workflow.py
@@ -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",
},
)
diff --git a/jenkins_jobs/modules/wrappers.py b/jenkins_jobs/modules/wrappers.py
index 4b9b70b4..09b9e2f4 100644
--- a/jenkins_jobs/modules/wrappers.py
+++ b/jenkins_jobs/modules/wrappers.py
@@ -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},
)