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

B #5019: fix reference when not called from sunstone (#430)

Signed-off-by: Carlos Herrera <cherrera@opennebula.io>
This commit is contained in:
Carlos J. Herrera 2020-11-16 12:04:14 -05:00 committed by GitHub
parent fd03fafb8f
commit 766f0f86fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -557,7 +557,14 @@ class DatacenterFolder
networks = {}
# Selected host in OpenNebula
one_client = OpenNebula::Client.new(nil, $conf[:one_xmlrpc])
if $conf.nil?
one_client = OpenNebula::Client.new
else
one_client = OpenNebula::Client.new(
nil,
$conf[:one_xmlrpc]
)
end
one_host = OpenNebula::Host.new_with_id(args[:host], one_client)
rc = one_host.info

View File

@ -23,7 +23,14 @@ class VIHelper
VM_PREFIX_DEFAULT = "one-$i-"
def self.client
@@client ||= OpenNebula::Client.new(nil, $conf[:one_xmlrpc]) # rubocop:disable Style/ClassVars
if $conf.nil?
@@client ||= OpenNebula::Client.new # rubocop:disable Style/ClassVars
else
@@client ||= OpenNebula::Client.new(
nil,
$conf[:one_xmlrpc]
)
end
end
def self.set_client(options, client=nil)