1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

F #3951: fix delete provider (#633)

Signed-off-by: Jorge Lobo <jlobo@opennebula.io>
This commit is contained in:
Jorge Miguel Lobo Escalona 2021-01-13 15:52:18 +01:00 committed by GitHub
parent 45a4f2fbbc
commit 436613ef23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,10 +155,12 @@ const deleteProvider = (res = {}, next = () => undefined, params = {}, userData
const executedCommand = executeCommand(defaultCommandProvider, paramsCommand)
const data = executedCommand.data || ''
try {
if (executedCommand) {
res.locals.httpCode = httpResponse(ok)
} else {
res.locals.httpCode = httpResponse(internalServerError, data)
if (executedCommand && executedCommand.success) {
if(executedCommand.data.length === 0){
res.locals.httpCode = httpResponse(ok)
} else {
res.locals.httpCode = httpResponse(internalServerError, '', executedCommand.data)
}
}
next()
return