diff --git a/plugins/kernel_v2/config/trigger.rb b/plugins/kernel_v2/config/trigger.rb index 3c40135e8..1945ed7a3 100644 --- a/plugins/kernel_v2/config/trigger.rb +++ b/plugins/kernel_v2/config/trigger.rb @@ -49,9 +49,6 @@ module VagrantPlugins # so the last element should be the "config block" # and the rest are commands for the trigger blk = command.pop - else - # TODO: - # No config block given at all, validation step should throw error? end command.each do |cmd| @@ -68,14 +65,12 @@ module VagrantPlugins def after(*command, &block) command.flatten! blk = block + if !block_given? && command.last.is_a?(Hash) # We were given a hash rather than a block, # so the last element should be the "config block" # and the rest are commands for the trigger blk = command.pop - else - # TODO: - # No config block given at all, validation step should throw error? end command.each do |cmd| diff --git a/plugins/kernel_v2/config/vm_trigger.rb b/plugins/kernel_v2/config/vm_trigger.rb index 91783f150..4eca2effe 100644 --- a/plugins/kernel_v2/config/vm_trigger.rb +++ b/plugins/kernel_v2/config/vm_trigger.rb @@ -17,7 +17,7 @@ module VagrantPlugins # Note: This is for internal use only. # # @return [String] - attr_accessor :id + attr_reader :id # Name for the given Trigger. Defaults to nil. #