1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-12 09:17:41 +03:00

F#2153 Now onehost flush use ONE_LOCATION env variable (#2165)

This commit is contained in:
Christian González 2018-06-11 10:33:02 +02:00 committed by Ruben S. Montero
parent 21375619e3
commit 1035df2b2f
2 changed files with 11 additions and 8 deletions

View File

@ -244,8 +244,17 @@ cmd=CommandParser::CmdParser.new(ARGV) do
EOT
command :flush, flush_desc, [:range,:hostid_list] do
begin
if !ONE_LOCATION
action = YAML.load_file("/etc/one/cli/onehost.yaml")[:default_actions][0][:flush]
else
action = YAML.load_file("#{ONE_LOCATION}/etc/cli/onehost.yaml")[:default_actions][0][:flush]
end
rescue Exception => e
STDERR.puts e
end
helper.perform_actions(args[0],options,"flush") do |host|
host.flush
host.flush action
end
end

View File

@ -125,15 +125,9 @@ module OpenNebula
set_status("OFFLINE")
end
def flush()
def flush(action)
self.disable
begin
action = YAML.load_file("/etc/one/cli/onehost.yaml")[:default_actions][0][:flush]
rescue Exception => e
STDERR.puts e
end
vm_pool = OpenNebula::VirtualMachinePool.new(@client,
VirtualMachinePool::INFO_ALL_VM)