lib/kitchen/driver/vagrant.rb in kitchen-vagrant-1.2.0 vs lib/kitchen/driver/vagrant.rb in kitchen-vagrant-1.2.1
- old
+ new
@@ -93,11 +93,11 @@
default_config :kitchen_cache_directory,
File.expand_path("~/.kitchen/cache")
default_config :cachier, nil
- # no_parallel_for :create, :destroy
+ no_parallel_for :create, :destroy
# Creates a Vagrant VM instance.
#
# @param state [Hash] mutable instance state
# @raise [ActionFailed] if the action could not be completed
@@ -376,18 +376,10 @@
# @param cmd [String] command to run locally
# @param options [Hash] options hash
# @see Kitchen::ShellOut.run_command
# @api private
def run(cmd, options = {})
- if vagrant_root && config[:provider] == "virtualbox"
- require "digest"
- options[:environment] = {} if options[:environment].nil?
- options[:environment]["VBOX_IPC_SOCKETID"] =
- Digest::SHA256.hexdigest(vagrant_root)
- options[:environment]["VBOX_USER_HOME"] = vagrant_root
- debug("Accessing isolated VirtualBox environment in #{vagrant_root}")
- end
cmd = "echo #{cmd}" if config[:dry_run]
run_command(cmd, { :cwd => vagrant_root }.merge(options))
end
# Delegates to Kitchen::ShellOut.run_command, overriding some default
@@ -446,15 +438,10 @@
# Runs a local command before `vagrant up` has been called.
#
# @api private
def run_pre_create_command
- if vagrant_root && config[:provider] == "virtualbox"
- run("vboxmanage setproperty machinefolder #{vagrant_root}",
- :cwd => config[:kitchen_root])
- debug("Set VirtualBox machinefolder to #{vagrant_root}")
- end
if config[:pre_create_command]
run(config[:pre_create_command], :cwd => config[:kitchen_root])
end
end
@@ -506,10 +493,10 @@
# @api private
def vagrant_root
if !@vagrant_root && !instance.nil?
@vagrant_root = File.join(
config[:kitchen_root], %w{.kitchen kitchen-vagrant},
- "kitchen-#{File.basename(config[:kitchen_root])}-#{instance.name}"
+ "#{instance.name}"
)
end
@vagrant_root
end