From 0c52c6cac36980a966f425ef2190bbd5db7de27a Mon Sep 17 00:00:00 2001 From: David Lundgren Date: Thu, 29 Mar 2018 09:51:43 -0500 Subject: [PATCH] Fixes for missing end blocks Also fixes the need to require the AWS plugin --- lib/vagrant-hostsupdater/HostsUpdater.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/vagrant-hostsupdater/HostsUpdater.rb b/lib/vagrant-hostsupdater/HostsUpdater.rb index a657fa3..56c2fa2 100644 --- a/lib/vagrant-hostsupdater/HostsUpdater.rb +++ b/lib/vagrant-hostsupdater/HostsUpdater.rb @@ -23,6 +23,7 @@ def getIps ips.push(ip) if ip if options[:hostsupdater] == 'skip' @ui.info '[vagrant-hostsupdater] Skipping adding host entries (config.vm.network hostsupdater: "skip" is set)' + end end end @@ -211,10 +212,12 @@ def sudo(command) def adviseOnSudo @ui.error "[vagrant-hostsupdater] Consider adding the following to your sudoers file:" @ui.error "[vagrant-hostsupdater] https://github.com/cogitatio/vagrant-hostsupdater#suppressing-prompts-for-elevating-privileges" + end private def getAwsPublicIp + return nil if ! defined?(VagrantPlugins::AWS) aws_conf = @machine.config.vm.get_provider_config(:aws) return nil if ! aws_conf.is_a?(VagrantPlugins::AWS::Config) filters = ( aws_conf.tags || [] ).map {|k,v| sprintf('"Name=tag:%s,Values=%s"', k, v) }.join(' ')