Enforce function declaration format in bash8
Check that function calls look like ^function foo {$ in bash8, and fix
all existing failures of that check. Add a note to HACKING.rst
Change-Id: Ic19eecb39e0b20273d1bcd551a42fe400d54e938
diff --git a/lib/keystone b/lib/keystone
index 73af1d3..0548c24 100644
--- a/lib/keystone
+++ b/lib/keystone
@@ -90,7 +90,7 @@
# ---------
# cleanup_keystone() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
-function cleanup_keystone() {
+function cleanup_keystone {
# kill instances (nova)
# delete image files (glance)
# This function intentionally left blank
@@ -98,14 +98,14 @@
}
# _cleanup_keystone_apache_wsgi() - Remove wsgi files, disable and remove apache vhost file
-function _cleanup_keystone_apache_wsgi() {
+function _cleanup_keystone_apache_wsgi {
sudo rm -f $KEYSTONE_WSGI_DIR/*.wsgi
disable_apache_site keystone
sudo rm -f /etc/$APACHE_NAME/$APACHE_CONF_DIR/keystone
}
# _config_keystone_apache_wsgi() - Set WSGI config files of Keystone
-function _config_keystone_apache_wsgi() {
+function _config_keystone_apache_wsgi {
sudo mkdir -p $KEYSTONE_WSGI_DIR
# copy proxy vhost and wsgi file
@@ -125,7 +125,7 @@
}
# configure_keystone() - Set config files, create data dirs, etc
-function configure_keystone() {
+function configure_keystone {
if [[ ! -d $KEYSTONE_CONF_DIR ]]; then
sudo mkdir -p $KEYSTONE_CONF_DIR
fi
@@ -272,7 +272,7 @@
# invisible_to_admin demo Member
# Migrated from keystone_data.sh
-create_keystone_accounts() {
+function create_keystone_accounts {
# admin
ADMIN_TENANT=$(openstack project create \
@@ -346,14 +346,14 @@
# Configure the API version for the OpenStack projects.
# configure_API_version conf_file version
-function configure_API_version() {
+function configure_API_version {
local conf_file=$1
local api_version=$2
iniset $conf_file keystone_authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v$api_version
}
# init_keystone() - Initialize databases, etc.
-function init_keystone() {
+function init_keystone {
if is_service_enabled ldap; then
init_ldap
fi
@@ -377,14 +377,14 @@
}
# install_keystoneclient() - Collect source and prepare
-function install_keystoneclient() {
+function install_keystoneclient {
git_clone $KEYSTONECLIENT_REPO $KEYSTONECLIENT_DIR $KEYSTONECLIENT_BRANCH
setup_develop $KEYSTONECLIENT_DIR
sudo install -D -m 0644 -o $STACK_USER {$KEYSTONECLIENT_DIR/tools/,/etc/bash_completion.d/}keystone.bash_completion
}
# install_keystone() - Collect source and prepare
-function install_keystone() {
+function install_keystone {
# only install ldap if the service has been enabled
if is_service_enabled ldap; then
install_ldap
@@ -408,7 +408,7 @@
}
# start_keystone() - Start running processes, including screen
-function start_keystone() {
+function start_keystone {
# Get right service port for testing
local service_port=$KEYSTONE_SERVICE_PORT
if is_service_enabled tls-proxy; then
@@ -436,7 +436,7 @@
}
# stop_keystone() - Stop running processes
-function stop_keystone() {
+function stop_keystone {
# Kill the Keystone screen window
screen_stop key
}