Ensure guest names are string when filtering
Prior to this commit, if a guest name was given as a symbol, the filter_triggers method would fail to properly match it with the only_on option, as it is not a valid type to the #String.match method. This commit fixes that by converting the parameter to a string so that it can be properly matched on the guest.
This commit is contained in:
parent
57c4de49f2
commit
eb3e309f89
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue