Skip to content

Commit

Permalink
JENKINS-59911 Chained assignment is not working in pipeline
Browse files Browse the repository at this point in the history
Found that groovy in pipeline is not supporting the chained assignment. In tests it's working well, but in pipeline value becomes null.

Get the details here: https://issues.jenkins-ci.org/browse/JENKINS-59911
  • Loading branch information
Sergei Parshev committed Oct 24, 2019
1 parent 48df9be commit 807fc47
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/com/griddynamics/devops/mpl/MPLConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ public class MPLConfig implements Map, Serializable {
else
throw new MPLException("Invalid config key path '${key_list[i-1] = '<'+key_list[i-1]+'>'; key_list.join('.')}': marked key value type '${parent?.getClass()}' is not suitable to set the nested variable")

if( value == null )
value = parent[key] = [:]
if( value == null ) {
parent[key] = [:]
value = parent[key]
}
}

parent[key] = val
Expand Down

0 comments on commit 807fc47

Please sign in to comment.