mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-18 05:18:24 +02:00
[refactor] re-use getConfigPropery inside getMandatoryProperty
... instead of accessing the config map directy. With that we ensure that getMandatoryProperty behaves the same like getConfigProperty. Currently we differ e.g. with trim().
This commit is contained in:
parent
a49c17c869
commit
64291cd88f
@ -109,10 +109,7 @@ class ConfigurationHelper implements Serializable {
|
||||
|
||||
def getMandatoryProperty(key, defaultValue = null, errorMessage = null) {
|
||||
|
||||
def paramValue = config[key]
|
||||
|
||||
if (paramValue == null)
|
||||
paramValue = defaultValue
|
||||
def paramValue = getConfigProperty(key, defaultValue)
|
||||
|
||||
if (paramValue == null) {
|
||||
if(! errorMessage) errorMessage = "ERROR - NO VALUE AVAILABLE FOR ${key}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user