diff --git a/lib/inprovise/fork/fork.rb b/lib/inprovise/fork/fork.rb index 83e949f..def64b5 100644 --- a/lib/inprovise/fork/fork.rb +++ b/lib/inprovise/fork/fork.rb @@ -23,7 +23,9 @@ def initialize(context, mode) end def verify_targets(*names) - if names.any? { |name| @context.node.name == name || Inprovise::Infrastructure.find(name).includes?(@context.node.name) } + tgts = names.collect { |name| Inprovise::Infrastructure.find(name) }.compact + raise ArgumentError, "Missing target node(s) for forked provisioning" if tgts.empty? + if tgts.any? { |tgt| @context.node.name == tgt.name || tgt.includes?(@context.node.name) } raise ArgumentError, "Not allowed to fork for same node as running context : #{@context.node.name}" end end diff --git a/lib/inprovise/fork/version.rb b/lib/inprovise/fork/version.rb index a5d8070..66a2b43 100644 --- a/lib/inprovise/fork/version.rb +++ b/lib/inprovise/fork/version.rb @@ -5,6 +5,6 @@ module Inprovise; module Fork - VERSION = '0.2.1' + VERSION = '0.2.2' end; end