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

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

No files matched your search

+5 -1
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
+10 -3
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