From ae516c6d6f3c3fcdca9961fa9a9ed6538db63463 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 25 Aug 2010 00:11:59 -0700 Subject: [PATCH] Make include and output work with `vagrant package` --- lib/vagrant/command/package.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/command/package.rb b/lib/vagrant/command/package.rb index a1da93b8a..36cab487d 100644 --- a/lib/vagrant/command/package.rb +++ b/lib/vagrant/command/package.rb @@ -17,14 +17,24 @@ module Vagrant def package_base vm = VM.find(options[:base], env) raise VMNotFoundError.new("Specified base VM not found: #{options[:base]}") if !vm.created? - vm.package(options) + package_vm(vm) end def package_target raise MultiVMTargetRequired.new("`vagrant package` requires the name of the VM to package in a multi-vm environment.") if target_vms.length > 1 vm = target_vms.first raise VMNotCreatedError.new("The VM must be created to package it. Run `vagrant up` first.") if !vm.created? - vm.package(options) + package_vm(vm) + end + + def package_vm(vm) + opts = options.inject({}) do |acc, data| + k,v = data + acc["package.#{k}"] = v + acc + end + + vm.package(opts) end end end