Ensure action param is a symbol, and if nil return to do nothing
This commit is contained in:
parent
6ac23f1a15
commit
08214ec90f
|
@ -100,14 +100,13 @@ module Vagrant
|
||||||
# a `nil` args will actually pass `nil` into the class.
|
# a `nil` args will actually pass `nil` into the class.
|
||||||
args ||= []
|
args ||= []
|
||||||
|
|
||||||
|
|
||||||
if klass.is_a?(Class)
|
if klass.is_a?(Class)
|
||||||
# A action klass which is to be instantiated with the
|
# A action klass which is to be instantiated with the
|
||||||
# app, env, and any arguments given
|
# app, env, and any arguments given
|
||||||
|
|
||||||
# We wrap the action class in two Trigger method calls so that
|
# We wrap the action class in two Trigger method calls so that
|
||||||
# action triggers can fire before and after each given action in the stack.
|
# action triggers can fire before and after each given action in the stack.
|
||||||
klass_name = klass.name.to_sym
|
klass_name = klass.name
|
||||||
[Vagrant::Action::Builtin::BeforeTriggerAction.new(self, env,
|
[Vagrant::Action::Builtin::BeforeTriggerAction.new(self, env,
|
||||||
klass_name,
|
klass_name,
|
||||||
@triggers),
|
@triggers),
|
||||||
|
|
|
@ -42,6 +42,13 @@ module Vagrant
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if !action
|
||||||
|
@logger.warn("Action given is nil, no triggers will fire")
|
||||||
|
return
|
||||||
|
else
|
||||||
|
action = action.to_sym
|
||||||
|
end
|
||||||
|
|
||||||
# get all triggers matching action
|
# get all triggers matching action
|
||||||
triggers = []
|
triggers = []
|
||||||
if stage == :before
|
if stage == :before
|
||||||
|
|
Loading…
Reference in New Issue