core: build action builder if responds to call
This commit is contained in:
parent
ae472dece9
commit
1550946b0c
|
@ -19,8 +19,16 @@ module Vagrant
|
|||
|
||||
def run(callable_id, options=nil)
|
||||
callable = callable_id
|
||||
callable = Builder.build(callable_id) if callable_id.kind_of?(Class) || callable_id.is_a?(Method)
|
||||
raise ArgumentError, "Argument to run must be a callable object or registered action." if !callable || !callable.respond_to?(:call)
|
||||
if !callable.kind_of?(Builder)
|
||||
if callable_id.kind_of?(Class) || callable_id.respond_to?(:call)
|
||||
callable = Builder.build(callable_id)
|
||||
end
|
||||
end
|
||||
|
||||
if !callable || !callable.respond_to?(:call)
|
||||
raise ArgumentError,
|
||||
"Argument to run must be a callable object or registered action."
|
||||
end
|
||||
|
||||
# Create the initial environment with the options given
|
||||
environment = {}
|
||||
|
|
Loading…
Reference in New Issue