lib/vagrant-mutate/mutate.rb in vagrant-mutate-1.0.4 vs lib/vagrant-mutate/mutate.rb in vagrant-mutate-1.1.0
- old
+ new
@@ -6,10 +6,11 @@
class Mutate < Vagrant.plugin(2, :command)
def execute
options = {}
options[:input_provider] = nil
options[:version] = nil
+ options[:force_virtio] = false
opts = OptionParser.new do |o|
o.banner = 'Usage: vagrant mutate <box-name-or-file-or-url> <provider>'
o.on('--input-provider PROVIDER',
'Specify provider for input box') do |p|
@@ -17,10 +18,14 @@
end
o.on('--version VERSION',
'Specify version for input box') do |p|
options[:version] = p
end
+ o.on('--force-virtio',
+ 'Force virtio disk driver') do |p|
+ options[:force_virtio] = true
+ end
end
argv = parse_options(opts)
return unless argv
@@ -39,10 +44,10 @@
input_box = input_loader.load(options[:box_arg], options[:input_provider], options[:version])
output_loader = BoxLoader.new(@env)
output_box = output_loader.prepare_for_output(input_box.name, options[:output_provider], input_box.version)
- converter = Converter::Converter.create(@env, input_box, output_box)
+ converter = Converter::Converter.create(@env, input_box, output_box, options[:force_virtio])
converter.convert
input_loader.cleanup
@env.ui.info "The box #{output_box.name} (#{output_box.provider_name}) is now ready to use."