vagrant-unbundled 2.2.0.0 → 2.2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -4
- data/CHANGELOG.md +49 -0
- data/lib/vagrant/action/builtin/box_check_outdated.rb +1 -0
- data/lib/vagrant/action/builtin/config_validate.rb +1 -1
- data/lib/vagrant/box.rb +27 -0
- data/lib/vagrant/bundler.rb +7 -2
- data/lib/vagrant/cli.rb +4 -0
- data/lib/vagrant/config/v2/root.rb +6 -2
- data/lib/vagrant/plugin/v2/communicator.rb +7 -0
- data/lib/vagrant/plugin/v2/trigger.rb +5 -1
- data/lib/vagrant/util/network_ip.rb +1 -26
- data/lib/vagrant/util/platform.rb +19 -7
- data/lib/vagrant/util/powershell.rb +23 -25
- data/lib/vagrant/util/ssh.rb +18 -5
- data/lib/vagrant/vagrantfile.rb +13 -2
- data/plugins/commands/login/plugin.rb +0 -1
- data/plugins/commands/validate/command.rb +17 -2
- data/plugins/communicators/ssh/communicator.rb +22 -12
- data/plugins/communicators/winrm/communicator.rb +5 -1
- data/plugins/communicators/winrm/shell.rb +25 -1
- data/plugins/guests/debian/cap/change_host_name.rb +66 -10
- data/plugins/guests/windows/cap/change_host_name.rb +4 -12
- data/plugins/guests/windows/cap/reboot.rb +36 -6
- data/plugins/guests/windows/plugin.rb +5 -0
- data/plugins/kernel_v2/config/vm.rb +8 -4
- data/plugins/providers/docker/action/host_machine_sync_folders.rb +2 -3
- data/plugins/providers/hyperv/provider.rb +15 -3
- data/plugins/providers/hyperv/scripts/delete_vm.ps1 +3 -0
- data/plugins/providers/hyperv/scripts/get_network_config.ps1 +1 -1
- data/plugins/providers/hyperv/scripts/set_network_vlan.ps1 +0 -6
- data/plugins/providers/hyperv/scripts/utils/VagrantVM/VagrantVM.psm1 +1 -1
- data/plugins/providers/virtualbox/action.rb +2 -0
- data/plugins/providers/virtualbox/action/network.rb +33 -42
- data/plugins/providers/virtualbox/action/set_default_nic_type.rb +69 -0
- data/plugins/providers/virtualbox/config.rb +10 -0
- data/plugins/providers/virtualbox/driver/meta.rb +1 -0
- data/plugins/providers/virtualbox/driver/version_5_0.rb +17 -6
- data/plugins/providers/virtualbox/driver/version_5_2.rb +2 -2
- data/plugins/providers/virtualbox/driver/version_6_0.rb +105 -0
- data/plugins/providers/virtualbox/plugin.rb +1 -0
- data/plugins/providers/virtualbox/synced_folder.rb +2 -1
- data/plugins/provisioners/docker/cap/linux/docker_configure_vagrant_user.rb +1 -0
- data/plugins/provisioners/shell/config.rb +4 -1
- data/plugins/provisioners/shell/provisioner.rb +6 -0
- data/plugins/synced_folders/smb/synced_folder.rb +18 -5
- data/templates/locales/en.yml +19 -3
- data/vagrant.gemspec +3 -1
- data/version.txt +1 -1
- metadata +407 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '092370f794df41aa0635fd8a28ca6cfb3b3bda4b23b073bbab6387cf3e5bff1b'
|
4
|
+
data.tar.gz: de1fccf9d6d443c4338db2870508c36fe0dd0807069be31898124fee88c7a5a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d45f2df2f9252d0de117c8f019ca22a418fdd58c1f5f8f9e6996f4e6e1b0e69a00be132324a80f4edc8babe724b7a5f5ff282eee71f8e05c5903e785bf56f56
|
7
|
+
data.tar.gz: adec6283e9e94b6585ba7ba4e19b203806503fed7cdd6562be94caa86ff89a08797b8e94b5e744e4eab3580b692831071460c7b145f853536bc2f2c054c0ddac
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,52 @@
|
|
1
|
+
## 2.2.2 (November 27, 2018)
|
2
|
+
|
3
|
+
BUG FIXES:
|
4
|
+
|
5
|
+
- providers/virtualbox: Update default_nic_type implementation and add warning [GH-10450]
|
6
|
+
|
7
|
+
## 2.2.1 (November 15, 2018)
|
8
|
+
|
9
|
+
FEATURES:
|
10
|
+
|
11
|
+
- core/plugins: Add reset! method to communicator [GH-10399]
|
12
|
+
- providers/virtualbox: Add support for VirtualBox 6.0 [GH-10379]
|
13
|
+
|
14
|
+
IMPROVEMENTS:
|
15
|
+
|
16
|
+
- command/validate: Allow validation of config while ignoring provider [GH-10351]
|
17
|
+
- communicators/ssh: Prevent overly verbose output waiting for connection [GH-10321]
|
18
|
+
- communicators/ssh: Support ed25519 keys [GH-10365]
|
19
|
+
- communicators/ssh: Add reset! implementation [GH-10399]
|
20
|
+
- communicators/winrm: Add reset! implementation [GH-10399]
|
21
|
+
- core: Limit number of automatic box update checks [GH-10359]
|
22
|
+
- host/windows: Remove PATH check in WSL detection [GH-10313]
|
23
|
+
- providers/hyperv: Disable automatic checkpoints before deletion [GH-10406]
|
24
|
+
- providers/virtualbox: Add `automount` flag if specified with synced_folder [GH-10326]
|
25
|
+
- providers/virtualbox: Refactor host only network settings [GH-7699]
|
26
|
+
- providers/virtualbox: Support setting default NIC type for network adapters [GH-10383]
|
27
|
+
- providers/virtualbox: Update ssh_port helper to handle multiple matches [GH-10409]
|
28
|
+
- provisioners/shell: Add :reset option to allow communicator reset [GH-10399]
|
29
|
+
- synced_folders/smb: Allow for 'default' smb_username in prompt if set [GH-10319]
|
30
|
+
- util/network_ip: Simplify `network_address` helper [GH-7693]
|
31
|
+
- util/platform: Prevent hard failure during hyper-v enabled check [GH-10332]
|
32
|
+
|
33
|
+
BUG FIXES:
|
34
|
+
|
35
|
+
- command/login: Only show deprecation warning when command is invoked [GH-10374]
|
36
|
+
- core: Fallback to Vagrantfile defined box information [GH-10368]
|
37
|
+
- core/bundler: Update source ordering to properly resolve with new RubyGems [GH-10364]
|
38
|
+
- core/triggers: Only split inline script if host is non-Windows [GH-10405]
|
39
|
+
- communicator/winrm: Prepend computer name to username when running elevated commands [GH-10387]
|
40
|
+
- guest/debian: Fix halting issue when setting hostname by restarting networking on guest [GH-10301, GH-10330]
|
41
|
+
- guest/linux: Fix vagrant user access to docker after install [GH-10399]
|
42
|
+
- guest/windows: Add reboot capability to fix hostname race condition [GH-10347]
|
43
|
+
- guest/windows: Allow for reading key paths with spaces [GH-10389]
|
44
|
+
- host/windows: Fix powershell to properly handle paths with spaces [GH-10390]
|
45
|
+
- providers/docker: Deterministic host VM synced folder location for Docker VM [GH-10311]
|
46
|
+
- providers/hyperv: Fix network vlan configuration script [GH-10366]
|
47
|
+
- providers/hyperv: Properly output error message on failed guest import [GH-10404]
|
48
|
+
- providers/hyperv: Fix typo in network configuration detection script [GH-10410]
|
49
|
+
|
1
50
|
## 2.2.0 (October 16, 2018)
|
2
51
|
|
3
52
|
FEATURES:
|
@@ -40,6 +40,7 @@ module Vagrant
|
|
40
40
|
# Have download options specified in the environment override
|
41
41
|
# options specified for the machine.
|
42
42
|
download_options = {
|
43
|
+
automatic_check: true,
|
43
44
|
ca_cert: env[:ca_cert] || machine.config.vm.box_download_ca_cert,
|
44
45
|
ca_path: env[:ca_path] || machine.config.vm.box_download_ca_path,
|
45
46
|
client_cert: env[:client_cert] ||
|
@@ -12,7 +12,7 @@ module Vagrant
|
|
12
12
|
|
13
13
|
def call(env)
|
14
14
|
if !env.key?(:config_validate) || env[:config_validate]
|
15
|
-
errors = env[:machine].config.validate(env[:machine])
|
15
|
+
errors = env[:machine].config.validate(env[:machine], env[:ignore_provider])
|
16
16
|
|
17
17
|
if errors && !errors.empty?
|
18
18
|
raise Errors::ConfigInvalid,
|
data/lib/vagrant/box.rb
CHANGED
@@ -16,6 +16,9 @@ module Vagrant
|
|
16
16
|
class Box
|
17
17
|
include Comparable
|
18
18
|
|
19
|
+
# Number of seconds to wait between checks for box updates
|
20
|
+
BOX_UPDATE_CHECK_INTERVAL = 3600
|
21
|
+
|
19
22
|
# The box name. This is the logical name used when adding the box.
|
20
23
|
#
|
21
24
|
# @return [String]
|
@@ -154,6 +157,11 @@ module Vagrant
|
|
154
157
|
raise Errors::BoxUpdateNoMetadata, name: @name
|
155
158
|
end
|
156
159
|
|
160
|
+
if download_options.delete(:automatic_check) && !automatic_update_check_allowed?
|
161
|
+
@logger.info("Skipping box update check")
|
162
|
+
return
|
163
|
+
end
|
164
|
+
|
157
165
|
version += ", " if version
|
158
166
|
version ||= ""
|
159
167
|
version += "> #{@version}"
|
@@ -164,6 +172,25 @@ module Vagrant
|
|
164
172
|
[md, newer, newer.provider(@provider)]
|
165
173
|
end
|
166
174
|
|
175
|
+
# Check if a box update check is allowed. Uses a file
|
176
|
+
# in the box data directory to track when the last auto
|
177
|
+
# update check was performed and returns true if the
|
178
|
+
# BOX_UPDATE_CHECK_INTERVAL has passed.
|
179
|
+
#
|
180
|
+
# @return [Boolean]
|
181
|
+
def automatic_update_check_allowed?
|
182
|
+
check_path = directory.join("box_update_check")
|
183
|
+
if check_path.exist?
|
184
|
+
last_check_span = Time.now.to_i - check_path.mtime.to_i
|
185
|
+
if last_check_span < BOX_UPDATE_CHECK_INTERVAL
|
186
|
+
@logger.info("box update check is under the interval threshold")
|
187
|
+
return false
|
188
|
+
end
|
189
|
+
end
|
190
|
+
FileUtils.touch(check_path)
|
191
|
+
true
|
192
|
+
end
|
193
|
+
|
167
194
|
# This repackages this box and outputs it to the given path.
|
168
195
|
#
|
169
196
|
# @param [Pathname] path The full path (filename included) of where
|
data/lib/vagrant/bundler.rb
CHANGED
@@ -24,8 +24,8 @@ module Vagrant
|
|
24
24
|
|
25
25
|
# Default gem repositories
|
26
26
|
DEFAULT_GEM_SOURCES = [
|
27
|
-
|
28
|
-
|
27
|
+
HASHICORP_GEMSTORE,
|
28
|
+
"https://rubygems.org/".freeze
|
29
29
|
].freeze
|
30
30
|
|
31
31
|
def self.instance
|
@@ -62,7 +62,12 @@ module Vagrant
|
|
62
62
|
|
63
63
|
# Add HashiCorp RubyGems source
|
64
64
|
if !Gem.sources.include?(HASHICORP_GEMSTORE)
|
65
|
+
current_sources = Gem.sources.sources.dup
|
66
|
+
Gem.sources.clear
|
65
67
|
Gem.sources << HASHICORP_GEMSTORE
|
68
|
+
current_sources.each do |src|
|
69
|
+
Gem.sources << src
|
70
|
+
end
|
66
71
|
end
|
67
72
|
|
68
73
|
# Generate dependencies for all registered plugins
|
data/lib/vagrant/cli.rb
CHANGED
@@ -23,6 +23,10 @@ module Vagrant
|
|
23
23
|
return 0
|
24
24
|
end
|
25
25
|
|
26
|
+
if @sub_command == "login"
|
27
|
+
$stderr.puts "WARNING: This command has been deprecated and aliased to `vagrant cloud auth login`"
|
28
|
+
end
|
29
|
+
|
26
30
|
# If we reached this far then we must have a subcommand. If not,
|
27
31
|
# then we also just print the help and exit.
|
28
32
|
command_plugin = nil
|
@@ -60,14 +60,18 @@ module Vagrant
|
|
60
60
|
#
|
61
61
|
# @param [Environment] env
|
62
62
|
# @return [Hash]
|
63
|
-
def validate(machine)
|
63
|
+
def validate(machine, ignore_provider=nil)
|
64
64
|
# Go through each of the configuration keys and validate
|
65
65
|
errors = {}
|
66
66
|
@keys.each do |_key, instance|
|
67
67
|
if instance.respond_to?(:validate)
|
68
68
|
# Validate this single item, and if we have errors then
|
69
69
|
# we merge them into our total errors list.
|
70
|
-
|
70
|
+
if _key == :vm
|
71
|
+
result = instance.validate(machine, ignore_provider)
|
72
|
+
else
|
73
|
+
result = instance.validate(machine)
|
74
|
+
end
|
71
75
|
if result && !result.empty?
|
72
76
|
errors = Util.merge_errors(errors, result)
|
73
77
|
end
|
@@ -117,6 +117,13 @@ module Vagrant
|
|
117
117
|
# @see #execute
|
118
118
|
def test(command, opts=nil)
|
119
119
|
end
|
120
|
+
|
121
|
+
# Reset the communicator. For communicators which establish
|
122
|
+
# a persistent connection to the remote machine, this connection
|
123
|
+
# should be terminated and re-established. The communicator
|
124
|
+
# instance should be in a "fresh" state after calling this method.
|
125
|
+
def reset!
|
126
|
+
end
|
120
127
|
end
|
121
128
|
end
|
122
129
|
end
|
@@ -161,7 +161,11 @@ module Vagrant
|
|
161
161
|
# @param [Provisioners::Shell::Config] config A Shell provisioner config
|
162
162
|
def run(config, on_error, exit_codes)
|
163
163
|
if config.inline
|
164
|
-
|
164
|
+
if Vagrant::Util::Platform.windows?
|
165
|
+
cmd = config.inline
|
166
|
+
else
|
167
|
+
cmd = Shellwords.split(config.inline)
|
168
|
+
end
|
165
169
|
|
166
170
|
@machine.ui.detail(I18n.t("vagrant.trigger.run.inline", command: config.inline))
|
167
171
|
else
|
@@ -5,34 +5,9 @@ module Vagrant
|
|
5
5
|
module NetworkIP
|
6
6
|
# Returns the network address of the given IP and subnet.
|
7
7
|
#
|
8
|
-
# If the IP address is an IPv6 address, subnet should be a prefix
|
9
|
-
# length such as "64".
|
10
|
-
#
|
11
8
|
# @return [String]
|
12
9
|
def network_address(ip, subnet)
|
13
|
-
|
14
|
-
if subnet.to_s =~ /^\d+$/
|
15
|
-
ip = IPAddr.new(ip)
|
16
|
-
return ip.mask(subnet.to_i).to_s
|
17
|
-
end
|
18
|
-
|
19
|
-
ip = ip_parts(ip)
|
20
|
-
netmask = ip_parts(subnet)
|
21
|
-
|
22
|
-
# Bitwise-AND each octet to get the network address
|
23
|
-
# in octets and join each part with a period to get
|
24
|
-
# the resulting network address.
|
25
|
-
ip.map { |part| part & netmask.shift }.join(".")
|
26
|
-
end
|
27
|
-
|
28
|
-
protected
|
29
|
-
|
30
|
-
# Splits an IP into the four octets and returns each as an
|
31
|
-
# integer in an array.
|
32
|
-
#
|
33
|
-
# @return [Array<Integer>]
|
34
|
-
def ip_parts(ip)
|
35
|
-
ip.split(".").map { |i| i.to_i }
|
10
|
+
IPAddr.new(ip).mask(subnet).to_s
|
36
11
|
end
|
37
12
|
end
|
38
13
|
end
|
@@ -13,6 +13,14 @@ module Vagrant
|
|
13
13
|
# This class just contains some platform checking code.
|
14
14
|
class Platform
|
15
15
|
class << self
|
16
|
+
|
17
|
+
def logger
|
18
|
+
if !defined?(@_logger)
|
19
|
+
@_logger = Log4r::Logger.new("vagrant::util::platform")
|
20
|
+
end
|
21
|
+
@_logger
|
22
|
+
end
|
23
|
+
|
16
24
|
def cygwin?
|
17
25
|
if !defined?(@_cygwin)
|
18
26
|
@_cygwin = ENV["VAGRANT_DETECTED_OS"].to_s.downcase.include?("cygwin") ||
|
@@ -35,11 +43,10 @@ module Vagrant
|
|
35
43
|
if !defined?(@_wsl)
|
36
44
|
@_wsl = false
|
37
45
|
SilenceWarnings.silence! do
|
38
|
-
#
|
39
|
-
if
|
40
|
-
|
41
|
-
|
42
|
-
if uname.exit_code == 0 && uname.stdout.downcase.include?("microsoft")
|
46
|
+
# Find 'microsoft' in /proc/version indicative of WSL
|
47
|
+
if File.file?('/proc/version')
|
48
|
+
osversion = File.open('/proc/version', &:gets)
|
49
|
+
if osversion.downcase.include?("microsoft")
|
43
50
|
@_wsl = true
|
44
51
|
end
|
45
52
|
end
|
@@ -134,8 +141,13 @@ module Vagrant
|
|
134
141
|
@_windows_hyperv_enabled = -> {
|
135
142
|
["Get-WindowsOptionalFeature", "Get-WindowsFeature"].each do |cmd_name|
|
136
143
|
ps_cmd = "$(#{cmd_name} -FeatureName Microsoft-Hyper-V-Hypervisor).State"
|
137
|
-
|
138
|
-
|
144
|
+
begin
|
145
|
+
output = Vagrant::Util::PowerShell.execute_cmd(ps_cmd)
|
146
|
+
return true if output == "Enabled"
|
147
|
+
rescue Errors::PowerShellInvalidVersion
|
148
|
+
logger.warn("Invalid PowerShell version detected during Hyper-V enable check")
|
149
|
+
return false
|
150
|
+
end
|
139
151
|
end
|
140
152
|
return false
|
141
153
|
}.call
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require "base64"
|
1
2
|
require "tmpdir"
|
2
3
|
require_relative "subprocess"
|
3
4
|
require_relative "which"
|
@@ -208,18 +209,26 @@ module Vagrant
|
|
208
209
|
# @return [Array<String>]
|
209
210
|
def self.powerup_command(path, args, opts)
|
210
211
|
Dir.mktmpdir("vagrant") do |dpath|
|
211
|
-
all_args = [
|
212
|
-
|
212
|
+
all_args = [path] + args.flatten.map{ |a|
|
213
|
+
a.gsub(/^['"](.+)['"]$/, "\\1")
|
214
|
+
}
|
215
|
+
arg_list = "\"" + all_args.join("\" \"") + "\""
|
213
216
|
stdout = File.join(dpath, "stdout.txt")
|
214
217
|
stderr = File.join(dpath, "stderr.txt")
|
215
|
-
exitcode = File.join(dpath, "exitcode.txt")
|
216
218
|
|
217
|
-
script = "
|
218
|
-
|
219
|
-
"if($sp){ Set-Content -Path '#{exitcode}' -Value $sp.ExitCode;exit $sp.ExitCode; }else{ exit 1 }"
|
219
|
+
script = "& #{arg_list} ; exit $LASTEXITCODE;"
|
220
|
+
script_content = Base64.urlsafe_encode64(script.encode("UTF-16LE", "UTF-8"))
|
220
221
|
|
221
|
-
#
|
222
|
-
|
222
|
+
# Wrap so we can redirect output to read later
|
223
|
+
wrapper = "$p = Start-Process -FilePath powershell -ArgumentList @('-NoLogo', '-NoProfile', " \
|
224
|
+
"'-NonInteractive', '-ExecutionPolicy', 'Bypass', '-EncodedCommand', '#{script_content}') " \
|
225
|
+
"-PassThru -WindowStyle Hidden -Wait -RedirectStandardOutput '#{stdout}' -RedirectStandardError '#{stderr}'; " \
|
226
|
+
"if($p){ exit $p.ExitCode; }else{ exit 1 }"
|
227
|
+
wrapper_content = Base64.urlsafe_encode64(wrapper.encode("UTF-16LE", "UTF-8"))
|
228
|
+
|
229
|
+
powerup = "$p = Start-Process -FilePath powershell -ArgumentList @('-NoLogo', '-NoProfile', " \
|
230
|
+
"'-NonInteractive', '-ExecutionPolicy', 'Bypass', '-EncodedCommand', '#{wrapper_content}') " \
|
231
|
+
"-PassThru -WindowStyle Hidden -Wait -Verb RunAs; if($p){ exit $p.ExitCode; }else{ exit 1 }"
|
223
232
|
|
224
233
|
cmd = [
|
225
234
|
"powershell",
|
@@ -227,31 +236,20 @@ module Vagrant
|
|
227
236
|
"-NoProfile",
|
228
237
|
"-NonInteractive",
|
229
238
|
"-ExecutionPolicy", "Bypass",
|
230
|
-
"-Command",
|
231
|
-
"@('-NoLogo', '-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-Command', '#{script}') " \
|
232
|
-
"-PassThru -Wait -WindowStyle Hidden -Verb RunAs; if($p){ exit $p.ExitCode; }else{ exit 1 }"
|
239
|
+
"-Command", powerup
|
233
240
|
]
|
234
241
|
|
235
242
|
result = Subprocess.execute(*cmd.push(opts))
|
243
|
+
r_stdout = result.stdout
|
236
244
|
if File.exist?(stdout)
|
237
|
-
r_stdout
|
238
|
-
else
|
239
|
-
r_stdout = result.stdout
|
245
|
+
r_stdout += File.read(stdout)
|
240
246
|
end
|
247
|
+
r_stderr = result.stderr
|
241
248
|
if File.exist?(stderr)
|
242
|
-
r_stderr
|
243
|
-
else
|
244
|
-
r_stderr = result.stderr
|
249
|
+
r_stderr += File.read(stderr)
|
245
250
|
end
|
246
251
|
|
247
|
-
|
248
|
-
if File.exist?(exitcode)
|
249
|
-
code_txt = File.read(exitcode).strip
|
250
|
-
if code_txt.match(/^\d+$/)
|
251
|
-
code = code_txt.to_i
|
252
|
-
end
|
253
|
-
end
|
254
|
-
Subprocess::Result.new(code, r_stdout, r_stderr)
|
252
|
+
Subprocess::Result.new(result.exit_code, r_stdout, r_stderr)
|
255
253
|
end
|
256
254
|
end
|
257
255
|
|
data/lib/vagrant/util/ssh.rb
CHANGED
@@ -150,11 +150,24 @@ module Vagrant
|
|
150
150
|
if !plain_mode && options[:private_key_path]
|
151
151
|
options[:private_key_path].each do |path|
|
152
152
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
153
|
+
private_key_arr = []
|
154
|
+
|
155
|
+
if path.include?('%')
|
156
|
+
if path.include?(' ') && Platform.windows?
|
157
|
+
LOGGER.warn("Paths with spaces and % on windows is not supported and will fail to read the file")
|
158
|
+
end
|
159
|
+
# Use '-o' instead of '-i' because '-i' does not call
|
160
|
+
# percent_expand in misc.c, but '-o' does. when passing the path,
|
161
|
+
# replace '%' in the path with '%%' to escape the '%'
|
162
|
+
path = path.to_s.gsub('%', '%%')
|
163
|
+
private_key_arr = ["-o", "IdentityFile=\"#{path}\""]
|
164
|
+
else
|
165
|
+
# Pass private key file directly with '-i', which properly supports
|
166
|
+
# paths with spaces on Windows guests
|
167
|
+
private_key_arr = ["-i", path]
|
168
|
+
end
|
169
|
+
|
170
|
+
command_options += private_key_arr
|
158
171
|
end
|
159
172
|
end
|
160
173
|
|
data/lib/vagrant/vagrantfile.rb
CHANGED
@@ -170,8 +170,8 @@ module Vagrant
|
|
170
170
|
|
171
171
|
# Track the original box so we know if we changed
|
172
172
|
box = nil
|
173
|
-
original_box = config.vm.box
|
174
|
-
original_version = config.vm.box_version
|
173
|
+
initial_box = original_box = config.vm.box
|
174
|
+
initial_version = original_version = config.vm.box_version
|
175
175
|
|
176
176
|
# Check if this machine has a local box metadata file
|
177
177
|
# describing the existing guest. If so, load it and
|
@@ -232,6 +232,17 @@ module Vagrant
|
|
232
232
|
# Load the box and provider overrides
|
233
233
|
load_box_proc.call
|
234
234
|
|
235
|
+
# NOTE: In cases where the box_meta file contains stale information
|
236
|
+
# and the reference box no longer exists, fall back to initial
|
237
|
+
# configuration and attempt to load that
|
238
|
+
if box.nil?
|
239
|
+
@logger.warn("Failed to locate #{config.vm.box} with version #{config.vm.box_version}")
|
240
|
+
@logger.warn("Performing lookup with inital values #{initial_box} with version #{initial_version}")
|
241
|
+
config.vm.box = original_box = initial_box
|
242
|
+
config.vm.box_version = original_box = initial_version
|
243
|
+
load_box_proc.call
|
244
|
+
end
|
245
|
+
|
235
246
|
# Ensure box attributes are set to original values in
|
236
247
|
# case they were modified by the local box metadata
|
237
248
|
config.vm.box = original_box
|