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/apache b/lib/apache
index 0e5712f..2d5e39a 100644
--- a/lib/apache
+++ b/lib/apache
@@ -50,7 +50,7 @@
#
# Uses global ``APACHE_ENABLED_SERVICES``
# APACHE_ENABLED_SERVICES service [service ...]
-function is_apache_enabled_service() {
+function is_apache_enabled_service {
services=$@
for service in ${services}; do
[[ ,${APACHE_ENABLED_SERVICES}, =~ ,${service}, ]] && return 0
@@ -59,7 +59,7 @@
}
# install_apache_wsgi() - Install Apache server and wsgi module
-function install_apache_wsgi() {
+function install_apache_wsgi {
# Apache installation, because we mark it NOPRIME
if is_ubuntu; then
# Install apache2, which is NOPRIME'd
@@ -79,7 +79,7 @@
}
# enable_apache_site() - Enable a particular apache site
-function enable_apache_site() {
+function enable_apache_site {
local site=$@
if is_ubuntu; then
sudo a2ensite ${site}
@@ -90,7 +90,7 @@
}
# disable_apache_site() - Disable a particular apache site
-function disable_apache_site() {
+function disable_apache_site {
local site=$@
if is_ubuntu; then
sudo a2dissite ${site}
@@ -100,12 +100,12 @@
}
# start_apache_server() - Start running apache server
-function start_apache_server() {
+function start_apache_server {
start_service $APACHE_NAME
}
# stop_apache_server() - Stop running apache server
-function stop_apache_server() {
+function stop_apache_server {
if [ -n "$APACHE_NAME" ]; then
stop_service $APACHE_NAME
else
@@ -114,7 +114,7 @@
}
# restart_apache_server
-function restart_apache_server() {
+function restart_apache_server {
restart_service $APACHE_NAME
}