1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #2468: add --force option to onehost sync

Also prints the hosts selected for upgrade
This commit is contained in:
Javi Fontan 2013-11-26 12:14:42 +01:00
parent 1078fea788
commit 0257d5bd7b
2 changed files with 15 additions and 4 deletions

View File

@ -218,7 +218,11 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
host_version=host[VERSION_XPATH]
next if host_version && host_version<=current_version
if !options[:force]
next if host_version && host_version >= current_version
end
puts "* Adding #{host['NAME']} to upgrade"
hs_threads[i % NUM_THREADS] ||= []
hs_threads[i % NUM_THREADS] << host

View File

@ -73,8 +73,14 @@ cmd=CommandParser::CmdParser.new(ARGV) do
:format => String
}
FORCE = {
:name => "force",
:large => "--force" ,
:description => "Force probe upgrade in onehost sync"
}
CREAT_OPTIONS = [ IM, VMM, VNET, OneClusterHelper::CLUSTER ]
SYNC_OPTIONS = [ OneClusterHelper::CLUSTER ]
SYNC_OPTIONS = [ OneClusterHelper::CLUSTER, FORCE ]
########################################################################
# Formatters for arguments
@ -173,8 +179,9 @@ cmd=CommandParser::CmdParser.new(ARGV) do
onehost sync host01,host02,host03
EOT
command :sync, sync_desc, [:range,:hostid_list, nil], :options=>SYNC_OPTIONS do
helper.sync(args[0],options)
command :sync, sync_desc, [:range, :hostid_list, nil],
:options=>SYNC_OPTIONS do
helper.sync(args[0], options)
end
list_desc = <<-EOT.unindent