Skip to content

Commit

Permalink
fix target check; bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Corino committed Sep 20, 2016
1 parent 2c577e2 commit a516ca8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/inprovise/fork/fork.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/inprovise/fork/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

module Inprovise; module Fork

VERSION = '0.2.1'
VERSION = '0.2.2'

end; end

0 comments on commit a516ca8

Please sign in to comment.