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

F #3951: fix prepend command (#698)

This commit is contained in:
Jorge Miguel Lobo Escalona 2021-01-27 19:05:17 +01:00 committed by GitHub
parent 01585cbf31
commit 55adb8c64c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -228,10 +228,15 @@ const addPrependCommand = (command = '', resource = '') => {
let newRsc = rsc
if (prependCommand) {
let splitPrepend = prependCommand.split(' ')
const splitPrepend = prependCommand.split(' ').filter(el => el !== '')
newCommand = splitPrepend[0]
splitPrepend = splitPrepend.splice(1)
newRsc = [...splitPrepend, command, ...rsc].filter(el => el !== '')
// remove command
splitPrepend.shift()
// stringify the rest of the parameters
const stringifyRestCommand = [command, ...rsc].join(' ')
newRsc = [...splitPrepend, stringifyRestCommand]
}
return {

View File

@ -571,6 +571,16 @@ const configureProvision = (res = {}, next = () => undefined, params = {}, userD
const command = 'configure'
const endpoint = getEndpoint()
const authCommand = ['--user', user, '--password', password]
const paramsCommand = [command, params.id, '--debug', '--json', '--fail_cleanup', '--batch', '--force', ...authCommand, ...endpoint]
let lastLine = ''
const uuid = v4()
const emit = message => {
message.toString().split(/\r|\n/).map(line => {
if (line) {
lastLine = line
publish(defaultCommandProvision, { id: params.id, data: lastLine, command: command, commandId: uuid })
}
})
const paramsCommand = [command, params.id, '--debug', '--json', '--force', '--fail_cleanup', '--batch', ...authCommand, ...endpoint]
// get Log file