mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-13 13:17:39 +03:00
F#2153 Now onehost flush
use ONE_LOCATION env variable (#2165)
This commit is contained in:
parent
21375619e3
commit
1035df2b2f
@ -244,8 +244,17 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|||||||
EOT
|
EOT
|
||||||
|
|
||||||
command :flush, flush_desc, [:range,:hostid_list] do
|
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|
|
helper.perform_actions(args[0],options,"flush") do |host|
|
||||||
host.flush
|
host.flush action
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -125,15 +125,9 @@ module OpenNebula
|
|||||||
set_status("OFFLINE")
|
set_status("OFFLINE")
|
||||||
end
|
end
|
||||||
|
|
||||||
def flush()
|
def flush(action)
|
||||||
self.disable
|
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,
|
vm_pool = OpenNebula::VirtualMachinePool.new(@client,
|
||||||
VirtualMachinePool::INFO_ALL_VM)
|
VirtualMachinePool::INFO_ALL_VM)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user