mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
F OpenNebula/one#5422: Fix delete provider
This commit is contained in:
parent
d0447e8423
commit
bcea10bc7f
@ -330,8 +330,9 @@ const executeCommand = (command = '', resource = '', options = {}) => {
|
||||
let rtn = { success: false, data: null }
|
||||
const { cmd, rsc } = addPrependCommand(command, resource)
|
||||
const execute = spawnSync(cmd, rsc, options)
|
||||
|
||||
if (execute) {
|
||||
if (execute.stdout) {
|
||||
if (execute.stdout && execute.status === 0) {
|
||||
rtn = { success: true, data: execute.stdout.toString() }
|
||||
} else if (execute.stderr && execute.stderr.length > 0) {
|
||||
rtn = { success: false, data: execute.stderr.toString() }
|
||||
|
@ -261,11 +261,9 @@ const deleteProvider = (res = {}, next = defaultEmptyFunction, params = {}, user
|
||||
const data = executedCommand.data || ''
|
||||
try {
|
||||
if (executedCommand && executedCommand.success) {
|
||||
if (executedCommand.data.length === 0) {
|
||||
res.locals.httpCode = httpResponse(ok)
|
||||
} else {
|
||||
res.locals.httpCode = httpResponse(internalServerError, '', executedCommand.data)
|
||||
}
|
||||
res.locals.httpCode = httpResponse(ok)
|
||||
} else {
|
||||
res.locals.httpCode = httpResponse(internalServerError, '', executedCommand.data)
|
||||
}
|
||||
next()
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user