From ef82c0a5bca529e8eb555c6bbcd167e3853046b0 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Thu, 22 Aug 2019 12:01:19 -0700 Subject: [PATCH] Move return earlier --- lib/vagrant/action/builtin/mixin_provisioners.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/vagrant/action/builtin/mixin_provisioners.rb b/lib/vagrant/action/builtin/mixin_provisioners.rb index af7c3ddcb..d3b0d20ef 100644 --- a/lib/vagrant/action/builtin/mixin_provisioners.rb +++ b/lib/vagrant/action/builtin/mixin_provisioners.rb @@ -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