Backwards compatible with_target_vms, fix failing test

This commit is contained in:
Mitchell Hashimoto 2012-03-23 11:29:10 -04:00
parent ff36845259
commit 351f9757a1
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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)