1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-16 11:09:33 +02:00

control flow: Replace if with case

This commit is contained in:
Marcus Holl 2019-02-07 09:08:31 +01:00
parent a4f879ea62
commit 5aecea02b6

View File

@ -256,7 +256,11 @@ public class ChangeManagement implements Serializable {
else else
shArgs.put('returnStatus', true) shArgs.put('returnStatus', true)
if(type == BackendType.RFC) { def result = 1
switch(type) {
case BackendType.RFC:
shArgs.script = command shArgs.script = command
@ -267,7 +271,6 @@ public class ChangeManagement implements Serializable {
dockerOptions = dockerOptions.plus(args) dockerOptions = dockerOptions.plus(args)
def result = 1
script.dockerExecute(script: script, script.dockerExecute(script: script,
dockerImage: dockerImage, dockerImage: dockerImage,
@ -277,20 +280,23 @@ public class ChangeManagement implements Serializable {
} }
return result break
} else { case BackendType.SOLMAN:
case BackendType.CTS:
def cmScript = getCMCommandLine(type, endpoint, script.username, script.password, shArgs.script = getCMCommandLine(type, endpoint, script.username, script.password,
command, args, command, args,
clientOpts) clientOpts)
shArgs.script = cmScript
// user and password are masked by withCredentials // user and password are masked by withCredentials
script.echo """[INFO] Executing command line: "${cmScript}".""" script.echo """[INFO] Executing command line: "${shArgs.script}"."""
return script.sh(shArgs) result = script.sh(shArgs)
break
} }
return result
} }
} }