From 98758fd4050ed55c6244c0dcc7923d3349c6cdfc Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Fri, 11 Nov 2016 15:26:11 -0800 Subject: [PATCH] If plugin is enabled multiple times fail When using the enable_plugin command and grenade jobs it can be easy to enable the same plugin twice, as the grenade job has a registration section and the configuration in project-config can also enable it due to code-reuse in project-config. If a plugin is enabled twice it will likely fail, though it won't be obvious that it was due to the plugin being enabled multiple times. This change makes it so if it sees the same plugin name is enabled more than once it will die and an error message outputted. Change-Id: I9f1d7e58b861b04473b6a57c9ad404203fb7277a (cherry picked from commit 21d84c29b22fb69b00739ae40d69f80d5182a94e) --- functions-common | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions-common b/functions-common index 4716567be3..9fe233b66c 100644 --- a/functions-common +++ b/functions-common @@ -1779,6 +1779,9 @@ function enable_plugin { local name=$1 local url=$2 local branch=${3:-master} + if [[ ",${DEVSTACK_PLUGINS}," =~ ,${name}, ]]; then + die $LINENO "Plugin attempted to be enabled twice: ${name} ${url} ${branch}" + fi DEVSTACK_PLUGINS+=",$name" GITREPO[$name]=$url GITDIR[$name]=$DEST/$name