Get local box metadata in remote box

This commit is contained in:
sophia 2022-03-07 10:42:35 -06:00 committed by Paul Hinze
parent e9e24986bd
commit 128599ab68
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
2 changed files with 9 additions and 2 deletions

View File

@ -34,6 +34,7 @@ module Vagrant
"Remote client is required for `#{self.class.name}'"
end
@client = client
@metadata = client.box_metadata
end
def destroy!

View File

@ -52,10 +52,16 @@ module VagrantPlugins
return machines
end
# @return [Hash] metadata
# @return [Hash] box metadata
def box_metadata
res = client.box_metadata(Empty.new)
mapper.map(res.metadata, to: Hash)
end
# @return [Hash] metadata (from metadata_url)
def metadata
res = client.metadata(Empty.new)
res.metadata
mapper.map(res.metadata, to: Hash)
end
# @return [String] metadata url