diff --git a/lib/vagrant/command/base.rb b/lib/vagrant/command/base.rb index e0298fc8b..babb65cab 100644 --- a/lib/vagrant/command/base.rb +++ b/lib/vagrant/command/base.rb @@ -71,6 +71,10 @@ module Vagrant # Setup the options hash options ||= {} + # Require that names be an array + names ||= [] + names = [names] if !names.is_a?(Array) + # First determine the proper array of VMs. vms = [] if names.length > 0 @@ -96,7 +100,7 @@ module Vagrant else vms = @env.vms_ordered end - + # Make sure we're only working with one VM if single target raise Errors::MultiVMTargetRequired if options[:single_target] && vms.length != 1 diff --git a/lib/vagrant/command/package.rb b/lib/vagrant/command/package.rb index c9d0392bf..a8c5f7180 100644 --- a/lib/vagrant/command/package.rb +++ b/lib/vagrant/command/package.rb @@ -54,7 +54,7 @@ module Vagrant end def package_target(name, options) - with_target_vms([ name ], :single_target => true) do |vm| + with_target_vms(name, :single_target => true) do |vm| raise Errors::VMNotCreatedError if !vm.created? @logger.debug("Packaging VM: #{vm.name}") package_vm(vm, options)