summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortanhengyeow <E0032242@u.nus.edu>2018-07-08 11:56:15 +0800
committertanhengyeow <E0032242@u.nus.edu>2018-07-09 23:03:12 +0800
commit1bf06f3fb58fd617689485b473c5388ecd51d505 (patch)
tree22f12597926cfd764efad0616193d3b7fb278ea1
parent11941c87f448ce525eec9a8ca77c00c2b119eee7 (diff)
Add commas to all mapping tuples in properties.py
Inserted appropriate commas after the last entry of the mapping variable to ensure consistency. Change-Id: I0519cae693f13994bc64f20b40d681a8eafdca55
Notes
Notes (review): Code-Review+2: Thanh Ha <zxiiro@gmail.com> Workflow+1: Thanh Ha <zxiiro@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 09 Jul 2018 16:53:34 +0000 Reviewed-on: https://review.openstack.org/580826 Project: openstack-infra/jenkins-job-builder Branch: refs/heads/master
-rw-r--r--jenkins_jobs/modules/properties.py36
1 files changed, 21 insertions, 15 deletions
diff --git a/jenkins_jobs/modules/properties.py b/jenkins_jobs/modules/properties.py
index 98f1d64..c1dbc36 100644
--- a/jenkins_jobs/modules/properties.py
+++ b/jenkins_jobs/modules/properties.py
@@ -201,7 +201,7 @@ def gitlab(registry, xml_parent, data):
201 'com.dabsquared.gitlabjenkins.connection.' 201 'com.dabsquared.gitlabjenkins.connection.'
202 'GitLabConnectionProperty') 202 'GitLabConnectionProperty')
203 mapping = [ 203 mapping = [
204 ('connection', 'gitLabConnection', None) 204 ('connection', 'gitLabConnection', None),
205 ] 205 ]
206 helpers.convert_mapping_to_xml(gitlab, data, mapping, fail_required=True) 206 helpers.convert_mapping_to_xml(gitlab, data, mapping, fail_required=True)
207 207
@@ -222,7 +222,8 @@ def least_load(registry, xml_parent, data):
222 'org.bstick12.jenkinsci.plugins.leastload.' 222 'org.bstick12.jenkinsci.plugins.leastload.'
223 'LeastLoadDisabledProperty') 223 'LeastLoadDisabledProperty')
224 mapping = [ 224 mapping = [
225 ('disabled', 'leastLoadDisabled', True)] 225 ('disabled', 'leastLoadDisabled', True),
226 ]
226 helpers.convert_mapping_to_xml(least, data, mapping, fail_required=True) 227 helpers.convert_mapping_to_xml(least, data, mapping, fail_required=True)
227 228
228 229
@@ -274,7 +275,7 @@ def throttle(registry, xml_parent, data):
274 matrixopt = XML.SubElement(throttle, 'matrixOptions') 275 matrixopt = XML.SubElement(throttle, 'matrixOptions')
275 mapping = [ 276 mapping = [
276 ('matrix-builds', 'throttleMatrixBuilds', True), 277 ('matrix-builds', 'throttleMatrixBuilds', True),
277 ('matrix-configs', 'throttleMatrixConfigurations', False) 278 ('matrix-configs', 'throttleMatrixConfigurations', False),
278 ] 279 ]
279 helpers.convert_mapping_to_xml( 280 helpers.convert_mapping_to_xml(
280 matrixopt, data, mapping, fail_required=True) 281 matrixopt, data, mapping, fail_required=True)
@@ -313,7 +314,8 @@ def branch_api(registry, xml_parent, data):
313 314
314 mapping = [ 315 mapping = [
315 ('time-period', 'durationName', 'Hour', valid_time_periods), 316 ('time-period', 'durationName', 'Hour', valid_time_periods),
316 ('number-of-builds', 'count', 1)] 317 ('number-of-builds', 'count', 1),
318 ]
317 helpers.convert_mapping_to_xml(branch, data, mapping, fail_required=True) 319 helpers.convert_mapping_to_xml(branch, data, mapping, fail_required=True)
318 320
319 321
@@ -524,7 +526,9 @@ def priority_sorter(registry, xml_parent, data):
524 'hudson.queueSorter.' 526 'hudson.queueSorter.'
525 'PrioritySorterJobProperty') 527 'PrioritySorterJobProperty')
526 528
527 mapping = [('priority', 'priority', None)] 529 mapping = [
530 ('priority', 'priority', None),
531 ]
528 532
529 helpers.convert_mapping_to_xml( 533 helpers.convert_mapping_to_xml(
530 priority_sorter_tag, data, mapping, fail_required=True) 534 priority_sorter_tag, data, mapping, fail_required=True)
@@ -571,8 +575,7 @@ def build_blocker(registry, xml_parent, data):
571 ('queue-scanning', 'scanQueueFor', 'DISABLED', 575 ('queue-scanning', 'scanQueueFor', 'DISABLED',
572 ('DISABLED', 'ALL', 'BUILDABLE')), 576 ('DISABLED', 'ALL', 'BUILDABLE')),
573 ] 577 ]
574 helpers.convert_mapping_to_xml( 578 helpers.convert_mapping_to_xml(blocker, data, mapping, fail_required=True)
575 blocker, data, mapping, fail_required=True)
576 579
577 580
578def copyartifact(registry, xml_parent, data): 581def copyartifact(registry, xml_parent, data):
@@ -664,7 +667,9 @@ def heavy_job(registry, xml_parent, data):
664 heavyjob = XML.SubElement(xml_parent, 667 heavyjob = XML.SubElement(xml_parent,
665 'hudson.plugins.' 668 'hudson.plugins.'
666 'heavy__job.HeavyJobProperty') 669 'heavy__job.HeavyJobProperty')
667 mapping = [('weight', 'weight', 1)] 670 mapping = [
671 ('weight', 'weight', 1),
672 ]
668 helpers.convert_mapping_to_xml(heavyjob, data, mapping, fail_required=True) 673 helpers.convert_mapping_to_xml(heavyjob, data, mapping, fail_required=True)
669 674
670 675
@@ -697,7 +702,8 @@ def slave_utilization(registry, xml_parent, data):
697 mapping = [ 702 mapping = [
698 ('', 'needsExclusiveAccessToNode', exclusive_node_access), 703 ('', 'needsExclusiveAccessToNode', exclusive_node_access),
699 ('', 'slaveUtilizationPercentage', percent), 704 ('', 'slaveUtilizationPercentage', percent),
700 ('single-instance-per-slave', 'singleInstancePerSlave', False)] 705 ('single-instance-per-slave', 'singleInstancePerSlave', False),
706 ]
701 helpers.convert_mapping_to_xml( 707 helpers.convert_mapping_to_xml(
702 utilization, data, mapping, fail_required=True) 708 utilization, data, mapping, fail_required=True)
703 709
@@ -755,7 +761,9 @@ def zeromq_event(registry, xml_parent, data):
755 zmq_event = XML.SubElement(xml_parent, 761 zmq_event = XML.SubElement(xml_parent,
756 'org.jenkinsci.plugins.' 762 'org.jenkinsci.plugins.'
757 'ZMQEventPublisher.HudsonNotificationProperty') 763 'ZMQEventPublisher.HudsonNotificationProperty')
758 mapping = [('', 'enabled', True)] 764 mapping = [
765 ('', 'enabled', True),
766 ]
759 helpers.convert_mapping_to_xml( 767 helpers.convert_mapping_to_xml(
760 zmq_event, data, mapping, fail_required=True) 768 zmq_event, data, mapping, fail_required=True)
761 769
@@ -940,8 +948,7 @@ def slave_prerequisites(registry, xml_parent, data):
940 'cmd': 'windows batch command', 948 'cmd': 'windows batch command',
941 'shell': 'shell script'}), 949 'shell': 'shell script'}),
942 ] 950 ]
943 helpers.convert_mapping_to_xml( 951 helpers.convert_mapping_to_xml(prereqs, data, mappings, fail_required=True)
944 prereqs, data, mappings, fail_required=True)
945 952
946 953
947def groovy_label(registry, xml_parent, data): 954def groovy_label(registry, xml_parent, data):
@@ -994,8 +1001,7 @@ def groovy_label(registry, xml_parent, data):
994 ('sandbox', 'sandbox', False), 1001 ('sandbox', 'sandbox', False),
995 ] 1002 ]
996 1003
997 helpers.convert_mapping_to_xml( 1004 helpers.convert_mapping_to_xml(security, data, mapping, fail_required=True)
998 security, data, mapping, fail_required=True)
999 if data and 'classpath' in data: 1005 if data and 'classpath' in data:
1000 classpath = XML.SubElement(security, 'classpath') 1006 classpath = XML.SubElement(security, 'classpath')
1001 for value in data['classpath']: 1007 for value in data['classpath']:
@@ -1082,7 +1088,7 @@ def docker_container(registry, xml_parent, data):
1082 ('commit-on-success', 'tagOnCompletion', False), 1088 ('commit-on-success', 'tagOnCompletion', False),
1083 ('additional-tag', 'additionalTag', ''), 1089 ('additional-tag', 'additionalTag', ''),
1084 ('push-on-success', 'pushOnSuccess', False), 1090 ('push-on-success', 'pushOnSuccess', False),
1085 ('clean-local-images', 'cleanImages', True) 1091 ('clean-local-images', 'cleanImages', True),
1086 ] 1092 ]
1087 helpers.convert_mapping_to_xml( 1093 helpers.convert_mapping_to_xml(
1088 xml_docker, data, mapping, fail_required=True) 1094 xml_docker, data, mapping, fail_required=True)