aboutsummaryrefslogtreecommitdiff
path: root/vars
diff options
context:
space:
mode:
authorMatt Rendina <rendinam@users.noreply.github.com>2018-11-28 14:40:02 -0500
committerGitHub <noreply@github.com>2018-11-28 14:40:02 -0500
commit63eb127f7262d5134f2800ab6f32e656b64fe608 (patch)
treea0637b71a7c8d610de7be9f2033807eec03780bb /vars
parent8944459d2f4347dd821b493646ac444c94d22673 (diff)
downloadjscu_refactor-63eb127f7262d5134f2800ab6f32e656b64fe608.tar.gz
Simplify iteration over configs and avoid bug exercised by position of (#23)1.2.7
JobConfig object in the list of items passed to run() function.
Diffstat (limited to 'vars')
-rw-r--r--vars/utils.groovy13
1 files changed, 6 insertions, 7 deletions
diff --git a/vars/utils.groovy b/vars/utils.groovy
index 50d17df..d6ee25c 100644
--- a/vars/utils.groovy
+++ b/vars/utils.groovy
@@ -229,18 +229,17 @@ def test_summary_notify(single_issue) {
// Test for type of list object and parse attributes accordingly.
def run(configs, concurrent = true) {
- // Split off any JobConfig object, leaving the config objects.
- def ljobconfig = new JobConfig() // Set default values.
+ // Create JobConfig with default values.
+ def ljobconfig = new JobConfig()
+
+ def tasks = [:]
configs.eachWithIndex { config, index ->
+
+ // Extract a JobConfig object if one is found.
if (config.getClass() == JobConfig) {
ljobconfig = config
- configs.remove(configs.indexOf(config))
return // effectively a 'continue' from within a closure.
}
- }
-
- def tasks = [:]
- configs.eachWithIndex { config, index ->
def BuildConfig myconfig = new BuildConfig() // MUST be inside eachWith loop.
myconfig = SerializationUtils.clone(config)