[COMMON] Fix function declarations bashisms 96/118996/10
authorGuillaume Lambert <guillaume.lambert@orange.com>
Tue, 9 Mar 2021 20:41:30 +0000 (21:41 +0100)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Wed, 14 Apr 2021 13:26:30 +0000 (13:26 +0000)
pointed out by checkbashisms.

$ mycmd=$(tox -e checkbashisms | grep "^possible .*'function' is useless
" | sed -e "s@^[^.]*\(.[^ ]*\) line \([0-9]*\) .*@sed -i -e '\2s/functio
n \\\([^ ()]*\\\) *(\\\?)\\\?/\\\1 ()/\' -e '\2s/(){/() {/' \1;@")

$ eval $mycmd

Issue-ID: OOM-2643
Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
Change-Id: Ic41c8ba8288b7a90db9f5775cd601c09ff2ab663

kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh
kubernetes/common/cassandra/resources/restore.sh
kubernetes/config/prepull_docker.sh
kubernetes/robot/demo-k8s.sh
kubernetes/robot/instantiate-k8s.sh
kubernetes/sdnc/resources/geo/bin/switchVoting.sh

index 25a5c31..c78daee 100755 (executable)
@@ -30,7 +30,7 @@
 #set -x
 */}}
 
-function enable_odl_cluster(){
+enable_odl_cluster () {
   if [ -z $APPC_REPLICAS ]; then
      echo "APPC_REPLICAS is not configured in Env field"
      exit
index 798ab6c..b56c0fa 100644 (file)
@@ -7,7 +7,7 @@ ss_name=""
 ss="snapshots"
 me=`basename $0`
 
-function find_target_table_name()
+find_target_table_name ()
 {
     dest_path=$1
     keyspace_name=$2
@@ -18,7 +18,7 @@ function find_target_table_name()
     printf $dest_table_name
 }
 
-function print_usage()
+print_usage ()
 {
        echo "NAME"
        echo "  Script to restore Cassandra database from Nuvo/Cain snapshot"
index ef46334..040adec 100755 (executable)
@@ -26,7 +26,7 @@ EOF
 #argument: yaml file
 #calling syntax: parse_yaml <yaml_file_name>
 
-function parse_yaml {
+parse_yaml () {
    local prefix=$2
    local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
    sed -ne "s|^\($s\):|\1|" \
index 5d8fed8..7ab384e 100755 (executable)
@@ -17,7 +17,7 @@
 #
 # Execute tags built to support the hands-on demo
 #
-function usage
+usage ()
 {
        echo "Usage: demo-k8s.sh <namespace> <command> [<parameters>] [execscript]"
        echo " "
index 67fd403..f10ad7e 100755 (executable)
@@ -19,7 +19,7 @@ NAMESPACE=
 FOLDER=
 POLL=0
 
-function check_required_parameter() {
+check_required_parameter () {
   # arg1 = parameter
   # arg2 = parameter name
   if [ -z "$1" ]; then
@@ -28,7 +28,7 @@ function check_required_parameter() {
   fi
 }
 
-function check_optional_paramater() {
+check_optional_paramater () {
   # arg1 = parameter
   # arg2 = parameter name
   if [ -z $1 ]; then
index 076f1ea..65b7626 100755 (executable)
@@ -16,7 +16,7 @@
 # limitations under the License.
 */}}
 
-function usage()
+usage ()
 {
     echo usage: switchVoting.sh primary\|secondary
     exit 1