Merge pull request #10854 from briancain/fixup-typed-trigger-actions
Ensure guest names are string when filtering trigger configs
This commit is contained in:
commit
f8eaa41b7e
|
@ -110,7 +110,7 @@ module Vagrant
|
||||||
match = false
|
match = false
|
||||||
if trigger.only_on
|
if trigger.only_on
|
||||||
trigger.only_on.each do |o|
|
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
|
# trigger matches on current guest, so we're fine to use it
|
||||||
match = true
|
match = true
|
||||||
break
|
break
|
||||||
|
|
|
@ -117,7 +117,7 @@ module VagrantPlugins
|
||||||
@command = command.to_sym
|
@command = command.to_sym
|
||||||
@ruby_block = UNSET_VALUE
|
@ruby_block = UNSET_VALUE
|
||||||
|
|
||||||
@logger.debug("Trigger defined for command: #{command}")
|
@logger.debug("Trigger defined for: #{command}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Config option `ruby` for a trigger which reads in a ruby block and sets
|
# Config option `ruby` for a trigger which reads in a ruby block and sets
|
||||||
|
|
|
@ -74,7 +74,7 @@ describe Vagrant::Plugin::V2::Trigger do
|
||||||
|
|
||||||
after_triggers = triggers.after_triggers
|
after_triggers = triggers.after_triggers
|
||||||
expect(after_triggers.size).to eq(3)
|
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)
|
expect(after_triggers.size).to eq(2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue