diff --git a/src/cli/one_helper/onehost_helper.rb b/src/cli/one_helper/onehost_helper.rb index 6f7731b77d..0ba5a6ad56 100644 --- a/src/cli/one_helper/onehost_helper.rb +++ b/src/cli/one_helper/onehost_helper.rb @@ -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 diff --git a/src/cli/onehost b/src/cli/onehost index 145f3bc616..ddc6b59012 100755 --- a/src/cli/onehost +++ b/src/cli/onehost @@ -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