Move return earlier
This commit is contained in:
parent
be5964a1db
commit
ef82c0a5bc
|
@ -55,6 +55,12 @@ module Vagrant
|
||||||
|
|
||||||
# extract root provisioners
|
# extract root provisioners
|
||||||
root_provs = pvs.map { |p,o| [p,o] if o[:before].nil? && o[:after].nil? }.reject(&:nil?)
|
root_provs = pvs.map { |p,o| [p,o] if o[:before].nil? && o[:after].nil? }.reject(&:nil?)
|
||||||
|
|
||||||
|
if root_provs.size == pvs.size
|
||||||
|
# no dependencies found
|
||||||
|
return pvs
|
||||||
|
end
|
||||||
|
|
||||||
# extract dependency provisioners
|
# extract dependency provisioners
|
||||||
dep_provs = pvs.map { |p,o| [p,o] if (!o[:before].nil? && !o[:before].is_a?(Symbol)) || (!o[:after].nil? && !o[:after].is_a?(Symbol)) }.reject(&:nil?)
|
dep_provs = pvs.map { |p,o| [p,o] if (!o[:before].nil? && !o[:before].is_a?(Symbol)) || (!o[:after].nil? && !o[:after].is_a?(Symbol)) }.reject(&:nil?)
|
||||||
# extract each provisioners
|
# extract each provisioners
|
||||||
|
@ -62,11 +68,6 @@ module Vagrant
|
||||||
# extract all provisioners
|
# extract all provisioners
|
||||||
all_provs = pvs.map { |p,o| [p,o] if o[:before] == :all || o[:after] == :all }.reject(&:nil?)
|
all_provs = pvs.map { |p,o| [p,o] if o[:before] == :all || o[:after] == :all }.reject(&:nil?)
|
||||||
|
|
||||||
if root_provs.size == pvs.size
|
|
||||||
# no dependencies found
|
|
||||||
return pvs
|
|
||||||
end
|
|
||||||
|
|
||||||
# TODO: Log here, that provisioner order is being changed
|
# TODO: Log here, that provisioner order is being changed
|
||||||
|
|
||||||
# insert provisioners in order
|
# insert provisioners in order
|
||||||
|
|
Loading…
Reference in New Issue