Move return earlier

This commit is contained in:
Brian Cain 2019-08-22 12:01:19 -07:00
parent be5964a1db
commit ef82c0a5bc
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
1 changed files with 6 additions and 5 deletions

View File

@ -55,6 +55,12 @@ module Vagrant
# extract root provisioners
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
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
@ -62,11 +68,6 @@ module Vagrant
# extract all provisioners
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
# insert provisioners in order