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

M #-: Fix auto monitor address for hybrid

This commit is contained in:
Ruben S. Montero 2020-05-25 19:42:57 +02:00
parent 2633bf64b5
commit 73c0a96747
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 11 additions and 5 deletions

View File

@ -147,7 +147,7 @@ end
#-------------------------------------------------------------------------------
# Script helper functions and gLobals
#-------------------------------------------------------------------------------
LOCAL_HYPERVISOR = %w[az ec2 one packet vcenter].freeze
LOCAL_HYPERVISOR = %w[az ec2 one packet].freeze
def local?(hypervisor)
LOCAL_HYPERVISOR.include?(hypervisor)
@ -170,11 +170,15 @@ begin
hostid = config.elements['HOST_ID'].text.to_s
if host == 'auto'
host = ENV['SSH_CLIENT'].split.first
if local? hyperv
host = '127.0.0.1'
else
host = ENV['SSH_CLIENT'].split.first
if host.to_s.empty?
puts 'NETWORK/MONITOR_ADDRESS is "auto", but SSH_CLIENT unknown'
exit(-1)
if host.to_s.empty?
puts 'NETWORK/MONITOR_ADDRESS is "auto", but SSH_CLIENT unknown'
exit(-1)
end
end
end

View File

@ -99,6 +99,8 @@ class VcenterMonitorManager
}
}
@conf[:address] = '127.0.0.1' if @conf[:address] == 'auto'
rescue StandardError
@mutex.synchronize {
@conf = DEFAULT_CONF.clone