mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 03:12:55 +09:00
feature #2468: add --force option to onehost sync
Also prints the hosts selected for upgrade
This commit is contained in:
1 parent
1078fea788
commit
0257d5bd7b
2 files changed
+15
-4
No files matched your search
@@ -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
@@ -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
|
||||
|
||||
Reference in new issue
Block a user