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

F #3951: fix target vmrc

Signed-off-by: Jorge Lobo <jlobo@opennebula.io>
This commit is contained in:
Jorge Lobo 2021-01-12 14:01:57 +01:00 committed by Tino Vázquez
parent da519d197d
commit 81e1104118
3 changed files with 18 additions and 20 deletions

View File

@ -22,9 +22,6 @@ limit_token:
min: 14
max: 30
# VMRC: use it for connect to vmrc. Its is a URL for the ESX server
vmrc: 'http://opennebula.io'
# Prepend for oneprovision command
oneprovision_prepend_command: ''

View File

@ -16,13 +16,15 @@ const { createProxyMiddleware } = require('http-proxy-middleware')
const { readFileSync } = require('fs-extra')
const { getConfig } = require('server/utils/yml')
const { messageTerminal } = require('server/utils/general')
const { genPathResources } = require('server/utils/server')
const { endpointVmrc } = require('server/utils/constants/defaults')
const { genPathResources, validateServerIsSecure } = require('server/utils/server')
const { endpointVmrc, defaultPort } = require('server/utils/constants/defaults')
genPathResources()
const appConfig = getConfig()
const url = appConfig.vmrc || ''
const port = appConfig.port || defaultPort
const protocol = validateServerIsSecure() ? 'https' : 'http'
const url = `${protocol}://localhost:${port}`
const config = {
color: 'red'
}

View File

@ -344,22 +344,21 @@ class SunstoneServer < CloudServer
if OpenNebula.is_error?(resource)
return [404, resource.to_json]
end
client = @client
vm_pool = VirtualMachinePool.new(client, -1)
user_pool = UserPool.new(client)
client = @client
vm_pool = VirtualMachinePool.new(client, -1)
user_pool = UserPool.new(client)
rc = user_pool.info
if OpenNebula.is_error?(rc)
puts rc.message
exit -1
end
rc = user_pool.info
if OpenNebula.is_error?(rc)
puts rc.message
exit -1
end
rc = vm_pool.info
if OpenNebula.is_error?(rc)
puts rc.message
exit -1
end
rc = vm_pool.info
if OpenNebula.is_error?(rc)
puts rc.message
exit -1
end
return vmrc.proxy(resource, client)
end