mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
control flow: Replace if with case
This commit is contained in:
parent
a4f879ea62
commit
5aecea02b6
@ -256,7 +256,11 @@ public class ChangeManagement implements Serializable {
|
||||
else
|
||||
shArgs.put('returnStatus', true)
|
||||
|
||||
if(type == BackendType.RFC) {
|
||||
def result = 1
|
||||
|
||||
switch(type) {
|
||||
|
||||
case BackendType.RFC:
|
||||
|
||||
shArgs.script = command
|
||||
|
||||
@ -267,7 +271,6 @@ public class ChangeManagement implements Serializable {
|
||||
|
||||
dockerOptions = dockerOptions.plus(args)
|
||||
|
||||
def result = 1
|
||||
|
||||
script.dockerExecute(script: script,
|
||||
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,
|
||||
clientOpts)
|
||||
|
||||
shArgs.script = cmScript
|
||||
|
||||
// user and password are masked by withCredentials
|
||||
script.echo """[INFO] Executing command line: "${cmScript}"."""
|
||||
return script.sh(shArgs)
|
||||
script.echo """[INFO] Executing command line: "${shArgs.script}"."""
|
||||
result = script.sh(shArgs)
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user