From fa55cb5f978f6bd9476f1b09a94c8d6aaa18beb4 Mon Sep 17 00:00:00 2001 From: Mathieu Mitchell Date: Tue, 24 Jan 2017 11:32:24 -0500 Subject: [PATCH] Ensure valid service names are passed to stack_install_service Currently, stack_install_service will accept any service name. This is problematic because a project plugin can pass an invalid name without noticing. This has been the case in ironic-inspector[0]. This commit ensures that stack_install_service will not silently fail when passing an invalid service name. [0] https://review.openstack.org/#/c/424680/ Change-Id: I1a8105bdbaf4aecb630df08da416808bf7180824 Closes-Bug: #1659042 --- lib/stack | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/stack b/lib/stack index f09ddcee85..bada26f1c2 100644 --- a/lib/stack +++ b/lib/stack @@ -33,5 +33,8 @@ function stack_install_service { if [[ ${USE_VENV} = True && -n ${PROJECT_VENV[$service]:-} ]]; then unset PIP_VIRTUAL_ENV fi + else + echo "No function declared with name 'install_${service}'." + exit 1 fi }