From dcdfcc92629fe32923998a46f7b8d157d2194f16 Mon Sep 17 00:00:00 2001 From: Seth Reeser Date: Thu, 6 Aug 2015 10:48:05 -0400 Subject: [PATCH] Reversing cf651497a2fec16abd1cd53f042a9a9d2a1bd45f as v1.6.0 has been a success. --- README.md | 5 ----- lib/vagrant-hostmanager/config.rb | 3 --- lib/vagrant-hostmanager/hosts_file/updater.rb | 13 +------------ test/Vagrantfile | 5 +---- 4 files changed, 2 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 05a39d0..f3d0b4e 100644 --- a/README.md +++ b/README.md @@ -59,11 +59,6 @@ up or have a private ip configured will be added to the hosts file. In addition, the `hostmanager.aliases` configuration attribute can be used to provide aliases for your host names. -On some systems, long alias lines have been reported to cause issues -(see [#60](https://github.com/smdahlen/vagrant-hostmanager/issues/60)). -In such cases, you may render aliases on separate lines by setting -```hostmanager.aliases_on_separate_lines = true```. - Example configuration: ```ruby diff --git a/lib/vagrant-hostmanager/config.rb b/lib/vagrant-hostmanager/config.rb index c2171ea..4e3d3dc 100644 --- a/lib/vagrant-hostmanager/config.rb +++ b/lib/vagrant-hostmanager/config.rb @@ -7,7 +7,6 @@ module VagrantPlugins attr_accessor :aliases attr_accessor :include_offline attr_accessor :ip_resolver - attr_accessor :aliases_on_separate_lines alias_method :enabled?, :enabled alias_method :include_offline?, :include_offline @@ -20,7 +19,6 @@ module VagrantPlugins @include_offline = UNSET_VALUE @aliases = UNSET_VALUE @ip_resolver = UNSET_VALUE - @aliases_on_separate_lines = UNSET_VALUE end def finalize! @@ -30,7 +28,6 @@ module VagrantPlugins @include_offline = false if @include_offline == UNSET_VALUE @aliases = [] if @aliases == UNSET_VALUE @ip_resolver = nil if @ip_resolver == UNSET_VALUE - @aliases_on_separate_lines = false if @aliases_on_separate_lines == UNSET_VALUE @aliases = [ @aliases ].flatten end diff --git a/lib/vagrant-hostmanager/hosts_file/updater.rb b/lib/vagrant-hostmanager/hosts_file/updater.rb index f936d7d..a82e37d 100644 --- a/lib/vagrant-hostmanager/hosts_file/updater.rb +++ b/lib/vagrant-hostmanager/hosts_file/updater.rb @@ -92,19 +92,8 @@ module VagrantPlugins ip = get_ip_address(machine, resolving_machine) host = machine.config.vm.hostname || machine.name aliases = machine.config.hostmanager.aliases - if ip != nil - # As per GH-60, we optionally render aliases on separate lines - current_machine_config = ((resolving_machine && resolving_machine.config) || @config) - if current_machine_config.hostmanager.aliases_on_separate_lines - rendered_aliases = aliases.map { |a| "#{ip}\t#{a}" }.join("\n") - separator = "\n" - else - rendered_aliases = aliases.join(" ") - separator = "\t" - end - - "#{ip}\t#{host}" + separator + rendered_aliases + "\n" + "#{ip}\t#{host}\n" + aliases.map{|a| "#{ip}\t#{a}"}.join("\n") + "\n" end end diff --git a/test/Vagrantfile b/test/Vagrantfile index 651b4a0..59ca656 100644 --- a/test/Vagrantfile +++ b/test/Vagrantfile @@ -16,19 +16,16 @@ Vagrant.configure('2') do |config| config.hostmanager.enabled = true config.hostmanager.manage_host = true - # config.hostmanager.aliases_on_separate_lines = true config.vm.define :server1 do |server| server.vm.hostname = 'fry' server.vm.network :private_network, :ip => '10.0.5.2' - server.hostmanager.aliases = %w(alias1 alias2) + server.hostmanager.aliases = %w(test-alias) end config.vm.define :server2 do |server| server.vm.hostname = 'bender' server.vm.network :private_network, :ip => '10.0.5.3' - server.hostmanager.aliases = %w(alias3 alias4) - server.hostmanager.aliases_on_separate_lines = true end config.vm.define :server3 do |server|