Add basic echo_* functions for grenade
Grenade, and possibly other components, re-use parts of devstack libraries. This provides basic echo_* functions to avoid missing commands in several libraries. Change-Id: I972d6208055a8c4ca4c9bfd5383ad3c7159d5cbe
This commit is contained in:
parent
ea937baee6
commit
54e3910f2d
18
functions
18
functions
@ -16,6 +16,10 @@ source ${FUNC_DIR}/functions-common
|
||||
XTRACE=$(set +o | grep xtrace)
|
||||
set +o xtrace
|
||||
|
||||
# Check if a function already exists
|
||||
function function_exists {
|
||||
declare -f -F $1 > /dev/null
|
||||
}
|
||||
|
||||
# Checks if installed Apache is <= given version
|
||||
# $1 = x.y.z (version string of Apache)
|
||||
@ -527,6 +531,20 @@ function setup_colorized_logging {
|
||||
iniset $conf_file $conf_section logging_exception_prefix "%(color)s%(asctime)s.%(msecs)03d TRACE %(name)s [01;35m%(instance)s[00m"
|
||||
}
|
||||
|
||||
# These functions are provided for basic fall-back functionality for
|
||||
# projects that include parts of devstack (grenade). stack.sh will
|
||||
# override these with more specific versions for devstack (with fancy
|
||||
# spinners, etc). We never override an existing version
|
||||
if ! function_exists echo_summary; then
|
||||
function echo_summary {
|
||||
echo $@
|
||||
}
|
||||
fi
|
||||
if ! function_exists echo_nolog; then
|
||||
function echo_nolog {
|
||||
echo $@
|
||||
}
|
||||
fi
|
||||
|
||||
# Restore xtrace
|
||||
$XTRACE
|
||||
|
Loading…
Reference in New Issue
Block a user