core: don't load vagrantfile on plugin command

This commit is contained in:
Mitchell Hashimoto 2013-11-23 13:25:33 -08:00
parent d0f08b1f23
commit de9d38de21
3 changed files with 13 additions and 7 deletions

View File

@ -25,6 +25,8 @@ BUG FIXES:
- core: 100% CPU spike when waiting for SSH is fixed. [GH-2401] - core: 100% CPU spike when waiting for SSH is fixed. [GH-2401]
- core: Command lookup works on systems where PATH is not valid UTF-8 [GH-2514] - core: Command lookup works on systems where PATH is not valid UTF-8 [GH-2514]
- core: Human-friendly error if box metadata.json becomes corrupted. [GH-2305] - core: Human-friendly error if box metadata.json becomes corrupted. [GH-2305]
- core: Don't load Vagrantfile on `vagrant plugin` commands, allowing
Vagrantfiles that use plugins to work. [GH-2388]
- guests/freebsd: Mounting NFS folders works. [GH-2400] - guests/freebsd: Mounting NFS folders works. [GH-2400]
- guests/freebsd: Uses `sh` by default for shell. [GH-2485] - guests/freebsd: Uses `sh` by default for shell. [GH-2485]
- guests/redhat: Down interface before messing up configuration file - guests/redhat: Down interface before messing up configuration file

View File

@ -64,7 +64,11 @@ opts[:ui_class] ||= Vagrant::UI::Colored
# of the plugin interface. # of the plugin interface.
ARGV.each do |arg| ARGV.each do |arg|
if !arg.start_with?("-") if !arg.start_with?("-")
ENV["VAGRANT_NO_PLUGINS"] = "1" if arg == "plugin" if arg == "plugin"
ENV["VAGRANT_NO_PLUGINS"] = "1"
ENV["VAGRANT_VAGRANTFILE"] = "plugin_command_#{Time.now.to_i}"
end
break break
end end
end end

View File

@ -67,7 +67,7 @@ module Vagrant
:local_data_path => nil, :local_data_path => nil,
:lock_path => nil, :lock_path => nil,
:ui_class => nil, :ui_class => nil,
:vagrantfile_name => nil :vagrantfile_name => nil,
}.merge(opts || {}) }.merge(opts || {})
# Set the default working directory to look for the vagrantfile # Set the default working directory to look for the vagrantfile