diff --git a/src/cli/onehost b/src/cli/onehost index a55067bc2d..986dc12e21 100755 --- a/src/cli/onehost +++ b/src/cli/onehost @@ -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 diff --git a/src/oca/ruby/opennebula/host.rb b/src/oca/ruby/opennebula/host.rb index 0bfa236b6d..2250642143 100644 --- a/src/oca/ruby/opennebula/host.rb +++ b/src/oca/ruby/opennebula/host.rb @@ -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)