Add box from ruby

This commit is contained in:
sophia 2021-11-16 14:39:59 -06:00 committed by Paul Hinze
parent c50ca3a991
commit c5de0d88f7
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
2 changed files with 5 additions and 4 deletions

View File

@ -24,8 +24,8 @@ module Vagrant
# @return [Vagrant::Box]
def add(path, name, version, **opts)
client.add(
path, name, version, force: opts[:force],
metadata_url: opts[:metadata_url], provider:opts[:providers]
path, name, version, force=opts[:force],
metadata_url=opts[:metadata_url], provider=opts[:providers]
)
end

View File

@ -7,9 +7,10 @@ module VagrantPlugins
# @return [Vagrant::Box] box added
def add(path, name, version, force=false, metadata_url=nil, providers=[])
logger.debug("adding box at path #{path}")
res = client.add(SDK::BoxCollection::AddRequest.new(
path: path, name: name, version: version, metadataUrl: metadata_url,
force: force, providers: providers
path: path.to_s, name: name, version: version, metadataUrl: metadata_url,
force: force, providers: Array(providers)
))
box_client = Box.load(res, broker: broker)
box = Vagrant::Box.new(