Browse code

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

Mathieu Mitchell authored on 2017/01/25 01:32:24
Showing 1 changed files
... ...
@@ -33,5 +33,8 @@ function stack_install_service {
33 33
         if [[ ${USE_VENV} = True && -n ${PROJECT_VENV[$service]:-} ]]; then
34 34
             unset PIP_VIRTUAL_ENV
35 35
         fi
36
+    else
37
+        echo "No function declared with name 'install_${service}'."
38
+        exit 1
36 39
     fi
37 40
 }