From 07bcfc6077fbee7a17cbbc75f9db727f0aa6e91b Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Wed, 28 Aug 2019 16:15:33 -0700 Subject: [PATCH] Add error if both before and after options are set --- plugins/kernel_v2/config/vm_provisioner.rb | 4 ++++ templates/locales/en.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/plugins/kernel_v2/config/vm_provisioner.rb b/plugins/kernel_v2/config/vm_provisioner.rb index 61f16ba4b..a8e106f7a 100644 --- a/plugins/kernel_v2/config/vm_provisioner.rb +++ b/plugins/kernel_v2/config/vm_provisioner.rb @@ -115,6 +115,10 @@ module VagrantPlugins provisioner_names = provisioners.map { |i| i.name if i.name != name }.reject(&:nil?) + if @before && @after + errors << I18n.t("vagrant.provisioners.base.both_before_after_set") + end + if @before if !VALID_BEFORE_AFTER_TYPES.include?(@before) if @before.is_a?(Symbol) && !VALID_BEFORE_AFTER_TYPES.include?(@before) diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 5629125d3..49d99187d 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -2487,6 +2487,8 @@ en: provisioners: base: + both_before_after_set: |- + Dependency provisioners cannot currently set both `before` and `after` options. dependency_provisioner_dependency: |- Dependency provisioner "%{name}" relies on another dependency provisioner "%{dep_name}". This is currently not supported. invalid_alias_value: |-