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

This commit is contained in:
Christian González authored and Ruben S. Montero committed 2018-06-26 10:57:04 +02:00
1 parent 21375619e3
commit 1035df2b2f
2 files changed
+11 -8

No files matched your search

+10 -1
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
+1 -7
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)