Respect Vagrantfile options to disable forwarded port
Closes GH-149
This commit is contained in:
parent
6b5db24a6b
commit
bf6e4b5c89
3 changed files with 11 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
IMPROVEMENTS:
|
||||
|
||||
- Warn users about unsupported private / public networking configs [#154](https://github.com/fgrehm/vagrant-lxc/issues/154)
|
||||
- Respect Vagrantfile options to disable forwarded port [#149](https://github.com/fgrehm/vagrant-lxc/issues/149)
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
|
|
|
@ -63,6 +63,9 @@ module Vagrant
|
|||
mappings = {}
|
||||
|
||||
config.vm.networks.each do |type, options|
|
||||
next if options[:disabled]
|
||||
|
||||
# TODO: Deprecate this behavior of "automagically" skipping ssh forwarded ports
|
||||
if type == :forwarded_port && options[:id] != 'ssh'
|
||||
options.delete(:host_ip) if options.fetch(:host_ip, '').to_s.strip.empty?
|
||||
mappings[options[:host]] = options
|
||||
|
|
|
@ -63,6 +63,13 @@ describe Vagrant::LXC::Action::ForwardPorts do
|
|||
pid_file.should == pid
|
||||
end
|
||||
|
||||
it 'allows disabling a previously forwarded port' do
|
||||
forward_conf[:disabled] = true
|
||||
subject.stub(system: true)
|
||||
subject.call(env)
|
||||
subject.should_not have_received(:spawn)
|
||||
end
|
||||
|
||||
it 'raises RedirNotInstalled error if `redir` is not installed' do
|
||||
subject.stub(system: false)
|
||||
lambda { subject.call(env) }.should raise_error(Vagrant::LXC::Errors::RedirNotInstalled)
|
||||
|
|
Loading…
Reference in a new issue