Skip to content

Commit

Permalink
Ensure valid service names are passed to stack_install_service
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mathieu Mitchell authored and mat128 committed Aug 1, 2017
1 parent 07d612e commit fa55cb5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/stack
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit fa55cb5

Please sign in to comment.