Get box update info
This commit is contained in:
parent
495902a5df
commit
35c094f570
@ -46,7 +46,7 @@ module Vagrant
|
||||
end
|
||||
|
||||
def has_update?(version=nil, **opts)
|
||||
client.has_update(version)
|
||||
client.update_info(version)
|
||||
end
|
||||
|
||||
def automatic_update_check_allowed?
|
||||
|
||||
@ -21,6 +21,22 @@ module VagrantPlugins
|
||||
res.has_update
|
||||
end
|
||||
|
||||
# @param [String] version
|
||||
# @return [Array] if there is an update available return an array of
|
||||
# [metadata (hash), version (string), provider (string)],
|
||||
# otherwise, return nil
|
||||
def update_info(version)
|
||||
res = client.update_info(SDK::Box::HasUpdateRequest.new(
|
||||
version: version
|
||||
))
|
||||
if res.has_update
|
||||
meta = mapper.map(res.metadata, to: Hash)
|
||||
return [meta, res.new_version, res.new_provider]
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
# @param [Sdk::Args::TargetIndex] index
|
||||
# @return [Bool] is in use
|
||||
def in_use(index)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user