Merge pull request #10854 from briancain/fixup-typed-trigger-actions

Ensure guest names are string when filtering trigger configs
This commit is contained in:
Brian Cain 2019-05-24 09:13:43 -07:00 committed by GitHub
commit f8eaa41b7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -110,7 +110,7 @@ module Vagrant
match = false
if trigger.only_on
trigger.only_on.each do |o|
if o.match(guest_name)
if o.match(guest_name.to_s)
# trigger matches on current guest, so we're fine to use it
match = true
break

View File

@ -117,7 +117,7 @@ module VagrantPlugins
@command = command.to_sym
@ruby_block = UNSET_VALUE
@logger.debug("Trigger defined for command: #{command}")
@logger.debug("Trigger defined for: #{command}")
end
# Config option `ruby` for a trigger which reads in a ruby block and sets

View File

@ -74,7 +74,7 @@ describe Vagrant::Plugin::V2::Trigger do
after_triggers = triggers.after_triggers
expect(after_triggers.size).to eq(3)
subject.send(:filter_triggers, after_triggers, "ubuntu", :action)
subject.send(:filter_triggers, after_triggers, :ubuntu, :action)
expect(after_triggers.size).to eq(2)
end