Browse code

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

Ian Wienand authored on 2014/02/21 13:35:08
Showing 94 changed files
... ...
@@ -275,3 +275,5 @@ Variables and Functions
275 275
 - local variables should be lower case, global variables should be
276 276
   upper case
277 277
 - function names should_have_underscores, NotCamelCase.
278
+- functions should be declared as per the regex ^function foo {$
279
+  with code starting on the next line
... ...
@@ -32,7 +32,7 @@ source $TOP_DIR/lib/cinder
32 32
 TEMPFILE=`mktemp`
33 33
 RECLONE=True
34 34
 
35
-function log_message() {
35
+function log_message {
36 36
     MESSAGE=$1
37 37
     STEP_HEADER=$2
38 38
     if [[ "$STEP_HEADER" = "True" ]]; then
... ...
@@ -57,7 +57,7 @@ AGGREGATE_NAME=test_aggregate_$RANDOM
57 57
 AGGREGATE2_NAME=test_aggregate_$RANDOM
58 58
 AGGREGATE_A_ZONE=nova
59 59
 
60
-exit_if_aggregate_present() {
60
+function exit_if_aggregate_present {
61 61
     aggregate_name=$1
62 62
 
63 63
     if [ $(nova aggregate-list | grep -c " $aggregate_name ") == 0 ]; then
... ...
@@ -154,7 +154,7 @@ set +o xtrace
154 154
 # Results
155 155
 # =======
156 156
 
157
-function report() {
157
+function report {
158 158
     if [[ -n "$2" ]]; then
159 159
         echo "$1: $2"
160 160
     fi
... ...
@@ -165,7 +165,7 @@ set +o xtrace
165 165
 # Results
166 166
 # =======
167 167
 
168
-function report() {
168
+function report {
169 169
     if [[ -n "$2" ]]; then
170 170
         echo "$1: $2"
171 171
     fi
... ...
@@ -20,7 +20,7 @@ echo "*********************************************************************"
20 20
 set -o errtrace
21 21
 
22 22
 trap failed ERR
23
-failed() {
23
+function failed {
24 24
     local r=$?
25 25
     set +o errtrace
26 26
     set +o xtrace
... ...
@@ -395,7 +395,7 @@ function test_functions {
395 395
 # Usage and main
396 396
 # --------------
397 397
 
398
-usage() {
398
+function usage {
399 399
     echo "$0: [-h]"
400 400
     echo "  -h, --help              Display help message"
401 401
     echo "  -t, --tenant            Create tenants"
... ...
@@ -408,7 +408,7 @@ usage() {
408 408
     echo "  -T, --test              Test functions"
409 409
 }
410 410
 
411
-main() {
411
+function main {
412 412
 
413 413
     echo Description
414 414
 
... ...
@@ -51,7 +51,7 @@ function cleanup_tmp {
51 51
 # - ``GLANCE_HOSTPORT``
52 52
 #
53 53
 # upload_image image-url glance-token
54
-function upload_image() {
54
+function upload_image {
55 55
     local image_url=$1
56 56
     local token=$2
57 57
 
... ...
@@ -341,7 +341,7 @@ function use_database {
341 341
 
342 342
 # Wait for an HTTP server to start answering requests
343 343
 # wait_for_service timeout url
344
-function wait_for_service() {
344
+function wait_for_service {
345 345
     local timeout=$1
346 346
     local url=$2
347 347
     timeout $timeout sh -c "while ! curl --noproxy '*' -s $url >/dev/null; do sleep 1; done"
... ...
@@ -351,7 +351,7 @@ function wait_for_service() {
351 351
 # ping check
352 352
 # Uses globals ``ENABLED_SERVICES``
353 353
 # ping_check from-net ip boot-timeout expected
354
-function ping_check() {
354
+function ping_check {
355 355
     if is_service_enabled neutron; then
356 356
         _ping_check_neutron  "$1" $2 $3 $4
357 357
         return
... ...
@@ -361,7 +361,7 @@ function ping_check() {
361 361
 
362 362
 # ping check for nova
363 363
 # Uses globals ``MULTI_HOST``, ``PRIVATE_NETWORK``
364
-function _ping_check_novanet() {
364
+function _ping_check_novanet {
365 365
     local from_net=$1
366 366
     local ip=$2
367 367
     local boot_timeout=$3
... ...
@@ -386,7 +386,7 @@ function _ping_check_novanet() {
386 386
 }
387 387
 
388 388
 # Get ip of instance
389
-function get_instance_ip(){
389
+function get_instance_ip {
390 390
     local vm_id=$1
391 391
     local network_name=$2
392 392
     local nova_result="$(nova show $vm_id)"
... ...
@@ -401,7 +401,7 @@ function get_instance_ip(){
401 401
 # ssh check
402 402
 
403 403
 # ssh_check net-name key-file floating-ip default-user active-timeout
404
-function ssh_check() {
404
+function ssh_check {
405 405
     if is_service_enabled neutron; then
406 406
         _ssh_check_neutron  "$1" $2 $3 $4 $5
407 407
         return
... ...
@@ -409,7 +409,7 @@ function ssh_check() {
409 409
     _ssh_check_novanet "$1" $2 $3 $4 $5
410 410
 }
411 411
 
412
-function _ssh_check_novanet() {
412
+function _ssh_check_novanet {
413 413
     local NET_NAME=$1
414 414
     local KEY_FILE=$2
415 415
     local FLOATING_IP=$3
... ...
@@ -425,7 +425,7 @@ function _ssh_check_novanet() {
425 425
 # Get the location of the $module-rootwrap executables, where module is cinder
426 426
 # or nova.
427 427
 # get_rootwrap_location module
428
-function get_rootwrap_location() {
428
+function get_rootwrap_location {
429 429
     local module=$1
430 430
 
431 431
     echo "$(get_python_exec_prefix)/$module-rootwrap"
... ...
@@ -434,7 +434,7 @@ function get_rootwrap_location() {
434 434
 
435 435
 # Path permissions sanity check
436 436
 # check_path_perm_sanity path
437
-function check_path_perm_sanity() {
437
+function check_path_perm_sanity {
438 438
     # Ensure no element of the path has 0700 permissions, which is very
439 439
     # likely to cause issues for daemons.  Inspired by default 0700
440 440
     # homedir permissions on RHEL and common practice of making DEST in
... ...
@@ -505,7 +505,7 @@ function _vercmp_r {
505 505
 # The above will return "0", as the versions are equal.
506 506
 #
507 507
 # vercmp_numbers ver1 ver2
508
-vercmp_numbers() {
508
+function vercmp_numbers {
509 509
     typeset v1=$1 v2=$2 sep
510 510
     typeset -a ver1 ver2
511 511
 
... ...
@@ -523,7 +523,7 @@ vercmp_numbers() {
523 523
 # Defaults are respectively 'project_name' and 'user_name'
524 524
 #
525 525
 # setup_colorized_logging something.conf SOMESECTION
526
-function setup_colorized_logging() {
526
+function setup_colorized_logging {
527 527
     local conf_file=$1
528 528
     local conf_section=$2
529 529
     local project_var=${3:-"project_name"}
... ...
@@ -38,7 +38,7 @@ set +o xtrace
38 38
 
39 39
 # Append a new option in an ini file without replacing the old value
40 40
 # iniadd config-file section option value1 value2 value3 ...
41
-function iniadd() {
41
+function iniadd {
42 42
     local xtrace=$(set +o | grep xtrace)
43 43
     set +o xtrace
44 44
     local file=$1
... ...
@@ -52,7 +52,7 @@ function iniadd() {
52 52
 
53 53
 # Comment an option in an INI file
54 54
 # inicomment config-file section option
55
-function inicomment() {
55
+function inicomment {
56 56
     local xtrace=$(set +o | grep xtrace)
57 57
     set +o xtrace
58 58
     local file=$1
... ...
@@ -64,7 +64,7 @@ function inicomment() {
64 64
 
65 65
 # Get an option from an INI file
66 66
 # iniget config-file section option
67
-function iniget() {
67
+function iniget {
68 68
     local xtrace=$(set +o | grep xtrace)
69 69
     set +o xtrace
70 70
     local file=$1
... ...
@@ -78,7 +78,7 @@ function iniget() {
78 78
 
79 79
 # Get a multiple line option from an INI file
80 80
 # iniget_multiline config-file section option
81
-function iniget_multiline() {
81
+function iniget_multiline {
82 82
     local xtrace=$(set +o | grep xtrace)
83 83
     set +o xtrace
84 84
     local file=$1
... ...
@@ -92,7 +92,7 @@ function iniget_multiline() {
92 92
 
93 93
 # Determinate is the given option present in the INI file
94 94
 # ini_has_option config-file section option
95
-function ini_has_option() {
95
+function ini_has_option {
96 96
     local xtrace=$(set +o | grep xtrace)
97 97
     set +o xtrace
98 98
     local file=$1
... ...
@@ -106,7 +106,7 @@ function ini_has_option() {
106 106
 
107 107
 # Set an option in an INI file
108 108
 # iniset config-file section option value
109
-function iniset() {
109
+function iniset {
110 110
     local xtrace=$(set +o | grep xtrace)
111 111
     set +o xtrace
112 112
     local file=$1
... ...
@@ -135,7 +135,7 @@ $option = $value
135 135
 
136 136
 # Set a multiple line option in an INI file
137 137
 # iniset_multiline config-file section option value1 value2 valu3 ...
138
-function iniset_multiline() {
138
+function iniset_multiline {
139 139
     local xtrace=$(set +o | grep xtrace)
140 140
     set +o xtrace
141 141
     local file=$1
... ...
@@ -167,7 +167,7 @@ $option = $v
167 167
 
168 168
 # Uncomment an option in an INI file
169 169
 # iniuncomment config-file section option
170
-function iniuncomment() {
170
+function iniuncomment {
171 171
     local xtrace=$(set +o | grep xtrace)
172 172
     set +o xtrace
173 173
     local file=$1
... ...
@@ -181,7 +181,7 @@ function iniuncomment() {
181 181
 # Accepts as False: 0 no No NO false False FALSE
182 182
 # Accepts as True: 1 yes Yes YES true True TRUE
183 183
 # VAR=$(trueorfalse default-value test-value)
184
-function trueorfalse() {
184
+function trueorfalse {
185 185
     local xtrace=$(set +o | grep xtrace)
186 186
     set +o xtrace
187 187
     local default=$1
... ...
@@ -213,7 +213,7 @@ function backtrace {
213 213
 
214 214
 # Prints line number and "message" then exits
215 215
 # die $LINENO "message"
216
-function die() {
216
+function die {
217 217
     local exitcode=$?
218 218
     set +o xtrace
219 219
     local line=$1; shift
... ...
@@ -231,7 +231,7 @@ function die() {
231 231
 # exit code is non-zero and prints "message" and exits
232 232
 # NOTE: env-var is the variable name without a '$'
233 233
 # die_if_not_set $LINENO env-var "message"
234
-function die_if_not_set() {
234
+function die_if_not_set {
235 235
     local exitcode=$?
236 236
     FXTRACE=$(set +o | grep xtrace)
237 237
     set +o xtrace
... ...
@@ -245,7 +245,7 @@ function die_if_not_set() {
245 245
 
246 246
 # Prints line number and "message" in error format
247 247
 # err $LINENO "message"
248
-function err() {
248
+function err {
249 249
     local exitcode=$?
250 250
     errXTRACE=$(set +o | grep xtrace)
251 251
     set +o xtrace
... ...
@@ -262,7 +262,7 @@ function err() {
262 262
 # exit code is non-zero and prints "message"
263 263
 # NOTE: env-var is the variable name without a '$'
264 264
 # err_if_not_set $LINENO env-var "message"
265
-function err_if_not_set() {
265
+function err_if_not_set {
266 266
     local exitcode=$?
267 267
     errinsXTRACE=$(set +o | grep xtrace)
268 268
     set +o xtrace
... ...
@@ -291,14 +291,14 @@ function exit_distro_not_supported {
291 291
 
292 292
 # Test if the named environment variable is set and not zero length
293 293
 # is_set env-var
294
-function is_set() {
294
+function is_set {
295 295
     local var=\$"$1"
296 296
     eval "[ -n \"$var\" ]" # For ex.: sh -c "[ -n \"$var\" ]" would be better, but several exercises depends on this
297 297
 }
298 298
 
299 299
 # Prints line number and "message" in warning format
300 300
 # warn $LINENO "message"
301
-function warn() {
301
+function warn {
302 302
     local exitcode=$?
303 303
     errXTRACE=$(set +o | grep xtrace)
304 304
     set +o xtrace
... ...
@@ -324,7 +324,7 @@ function warn() {
324 324
 # os_PACKAGE - package type
325 325
 # os_CODENAME - vendor's codename for release
326 326
 # GetOSVersion
327
-GetOSVersion() {
327
+function GetOSVersion {
328 328
     # Figure out which vendor we are
329 329
     if [[ -x "`which sw_vers 2>/dev/null`" ]]; then
330 330
         # OS/X
... ...
@@ -414,7 +414,7 @@ GetOSVersion() {
414 414
 
415 415
 # Translate the OS version values into common nomenclature
416 416
 # Sets global ``DISTRO`` from the ``os_*`` values
417
-function GetDistro() {
417
+function GetDistro {
418 418
     GetOSVersion
419 419
     if [[ "$os_VENDOR" =~ (Ubuntu) || "$os_VENDOR" =~ (Debian) ]]; then
420 420
         # 'Everyone' refers to Ubuntu / Debian releases by the code name adjective
... ...
@@ -491,7 +491,7 @@ function is_ubuntu {
491 491
 
492 492
 # Returns openstack release name for a given branch name
493 493
 # ``get_release_name_from_branch branch-name``
494
-function get_release_name_from_branch(){
494
+function get_release_name_from_branch {
495 495
     local branch=$1
496 496
     if [[ $branch =~ "stable/" ]]; then
497 497
         echo ${branch#*/}
... ...
@@ -577,7 +577,7 @@ function git_clone {
577 577
 # to timeout(1); otherwise the default value of 0 maintains the status
578 578
 # quo of waiting forever.
579 579
 # usage: git_timed <git-command>
580
-function git_timed() {
580
+function git_timed {
581 581
     local count=0
582 582
     local timeout=0
583 583
 
... ...
@@ -603,7 +603,7 @@ function git_timed() {
603 603
 
604 604
 # git update using reference as a branch.
605 605
 # git_update_branch ref
606
-function git_update_branch() {
606
+function git_update_branch {
607 607
 
608 608
     GIT_BRANCH=$1
609 609
 
... ...
@@ -615,7 +615,7 @@ function git_update_branch() {
615 615
 
616 616
 # git update using reference as a branch.
617 617
 # git_update_remote_branch ref
618
-function git_update_remote_branch() {
618
+function git_update_remote_branch {
619 619
 
620 620
     GIT_BRANCH=$1
621 621
 
... ...
@@ -625,7 +625,7 @@ function git_update_remote_branch() {
625 625
 # git update using reference as a tag. Be careful editing source at that repo
626 626
 # as working copy will be in a detached mode
627 627
 # git_update_tag ref
628
-function git_update_tag() {
628
+function git_update_tag {
629 629
 
630 630
     GIT_TAG=$1
631 631
 
... ...
@@ -641,7 +641,7 @@ function git_update_tag() {
641 641
 
642 642
 # Get the default value for HOST_IP
643 643
 # get_default_host_ip fixed_range floating_range host_ip_iface host_ip
644
-function get_default_host_ip() {
644
+function get_default_host_ip {
645 645
     local fixed_range=$1
646 646
     local floating_range=$2
647 647
     local host_ip_iface=$3
... ...
@@ -673,7 +673,7 @@ function get_default_host_ip() {
673 673
 # Fields are numbered starting with 1
674 674
 # Reverse syntax is supported: -1 is the last field, -2 is second to last, etc.
675 675
 # get_field field-number
676
-function get_field() {
676
+function get_field {
677 677
     while read data; do
678 678
         if [ "$1" -lt 0 ]; then
679 679
             field="(\$(NF$1))"
... ...
@@ -687,7 +687,7 @@ function get_field() {
687 687
 # Add a policy to a policy.json file
688 688
 # Do nothing if the policy already exists
689 689
 # ``policy_add policy_file policy_name policy_permissions``
690
-function policy_add() {
690
+function policy_add {
691 691
     local policy_file=$1
692 692
     local policy_name=$2
693 693
     local policy_perm=$3
... ...
@@ -717,7 +717,7 @@ function policy_add() {
717 717
 # =================
718 718
 
719 719
 # _get_package_dir
720
-function _get_package_dir() {
720
+function _get_package_dir {
721 721
     local pkg_dir
722 722
     if is_ubuntu; then
723 723
         pkg_dir=$FILES/apts
... ...
@@ -734,7 +734,7 @@ function _get_package_dir() {
734 734
 # Wrapper for ``apt-get`` to set cache and proxy environment variables
735 735
 # Uses globals ``OFFLINE``, ``*_proxy``
736 736
 # apt_get operation package [package ...]
737
-function apt_get() {
737
+function apt_get {
738 738
     local xtrace=$(set +o | grep xtrace)
739 739
     set +o xtrace
740 740
 
... ...
@@ -759,7 +759,7 @@ function apt_get() {
759 759
 # - ``# NOPRIME`` defers installation to be performed later in `stack.sh`
760 760
 # - ``# dist:DISTRO`` or ``dist:DISTRO1,DISTRO2`` limits the selection
761 761
 #   of the package to the distros listed.  The distro names are case insensitive.
762
-function get_packages() {
762
+function get_packages {
763 763
     local xtrace=$(set +o | grep xtrace)
764 764
     set +o xtrace
765 765
     local services=$@
... ...
@@ -870,7 +870,7 @@ function get_packages() {
870 870
 
871 871
 # Distro-agnostic package installer
872 872
 # install_package package [package ...]
873
-function install_package() {
873
+function install_package {
874 874
     local xtrace=$(set +o | grep xtrace)
875 875
     set +o xtrace
876 876
     if is_ubuntu; then
... ...
@@ -895,7 +895,7 @@ function install_package() {
895 895
 
896 896
 # Distro-agnostic function to tell if a package is installed
897 897
 # is_package_installed package [package ...]
898
-function is_package_installed() {
898
+function is_package_installed {
899 899
     if [[ -z "$@" ]]; then
900 900
         return 1
901 901
     fi
... ...
@@ -915,7 +915,7 @@ function is_package_installed() {
915 915
 
916 916
 # Distro-agnostic package uninstaller
917 917
 # uninstall_package package [package ...]
918
-function uninstall_package() {
918
+function uninstall_package {
919 919
     if is_ubuntu; then
920 920
         apt_get purge "$@"
921 921
     elif is_fedora; then
... ...
@@ -930,7 +930,7 @@ function uninstall_package() {
930 930
 # Wrapper for ``yum`` to set proxy environment variables
931 931
 # Uses globals ``OFFLINE``, ``*_proxy``
932 932
 # yum_install package [package ...]
933
-function yum_install() {
933
+function yum_install {
934 934
     [[ "$OFFLINE" = "True" ]] && return
935 935
     local sudo="sudo"
936 936
     [[ "$(id -u)" = "0" ]] && sudo="env"
... ...
@@ -941,7 +941,7 @@ function yum_install() {
941 941
 
942 942
 # zypper wrapper to set arguments correctly
943 943
 # zypper_install package [package ...]
944
-function zypper_install() {
944
+function zypper_install {
945 945
     [[ "$OFFLINE" = "True" ]] && return
946 946
     local sudo="sudo"
947 947
     [[ "$(id -u)" = "0" ]] && sudo="env"
... ...
@@ -958,7 +958,7 @@ function zypper_install() {
958 958
 # files to produce the same logs as screen_it().  The log filename is derived
959 959
 # from the service name and global-and-now-misnamed SCREEN_LOGDIR
960 960
 # _run_process service "command-line"
961
-function _run_process() {
961
+function _run_process {
962 962
     local service=$1
963 963
     local command="$2"
964 964
 
... ...
@@ -983,7 +983,7 @@ function _run_process() {
983 983
 # Helper to remove the ``*.failure`` files under ``$SERVICE_DIR/$SCREEN_NAME``.
984 984
 # This is used for ``service_check`` when all the ``screen_it`` are called finished
985 985
 # init_service_check
986
-function init_service_check() {
986
+function init_service_check {
987 987
     SCREEN_NAME=${SCREEN_NAME:-stack}
988 988
     SERVICE_DIR=${SERVICE_DIR:-${DEST}/status}
989 989
 
... ...
@@ -996,7 +996,7 @@ function init_service_check() {
996 996
 
997 997
 # Find out if a process exists by partial name.
998 998
 # is_running name
999
-function is_running() {
999
+function is_running {
1000 1000
     local name=$1
1001 1001
     ps auxw | grep -v grep | grep ${name} > /dev/null
1002 1002
     RC=$?
... ...
@@ -1009,7 +1009,7 @@ function is_running() {
1009 1009
 # of screen_it() without screen.  PIDs are written to
1010 1010
 # $SERVICE_DIR/$SCREEN_NAME/$service.pid
1011 1011
 # run_process service "command-line"
1012
-function run_process() {
1012
+function run_process {
1013 1013
     local service=$1
1014 1014
     local command="$2"
1015 1015
 
... ...
@@ -1092,7 +1092,7 @@ function screen_rc {
1092 1092
 # If screen is being used kill the screen window; this will catch processes
1093 1093
 # that did not leave a PID behind
1094 1094
 # screen_stop service
1095
-function screen_stop() {
1095
+function screen_stop {
1096 1096
     SCREEN_NAME=${SCREEN_NAME:-stack}
1097 1097
     SERVICE_DIR=${SERVICE_DIR:-${DEST}/status}
1098 1098
     USE_SCREEN=$(trueorfalse True $USE_SCREEN)
... ...
@@ -1112,7 +1112,7 @@ function screen_stop() {
1112 1112
 
1113 1113
 # Helper to get the status of each running service
1114 1114
 # service_check
1115
-function service_check() {
1115
+function service_check {
1116 1116
     local service
1117 1117
     local failures
1118 1118
     SCREEN_NAME=${SCREEN_NAME:-stack}
... ...
@@ -1145,7 +1145,7 @@ function service_check() {
1145 1145
 
1146 1146
 # Get the path to the pip command.
1147 1147
 # get_pip_command
1148
-function get_pip_command() {
1148
+function get_pip_command {
1149 1149
     which pip || which pip-python
1150 1150
 
1151 1151
     if [ $? -ne 0 ]; then
... ...
@@ -1155,7 +1155,7 @@ function get_pip_command() {
1155 1155
 
1156 1156
 # Get the path to the direcotry where python executables are installed.
1157 1157
 # get_python_exec_prefix
1158
-function get_python_exec_prefix() {
1158
+function get_python_exec_prefix {
1159 1159
     if is_fedora || is_suse; then
1160 1160
         echo "/usr/bin"
1161 1161
     else
... ...
@@ -1221,7 +1221,7 @@ function pip_install {
1221 1221
 #
1222 1222
 # Uses globals ``TRACK_DEPENDS``, ``REQUIREMENTS_DIR``, ``UNDO_REQUIREMENTS``
1223 1223
 # setup_develop directory
1224
-function setup_develop() {
1224
+function setup_develop {
1225 1225
     local project_dir=$1
1226 1226
 
1227 1227
     echo "cd $REQUIREMENTS_DIR; $SUDO_CMD python update.py $project_dir"
... ...
@@ -1257,7 +1257,7 @@ function setup_develop() {
1257 1257
 # using pip before running `setup.py develop`
1258 1258
 # Uses globals ``STACK_USER``
1259 1259
 # setup_develop_no_requirements_update directory
1260
-function setup_develop_no_requirements_update() {
1260
+function setup_develop_no_requirements_update {
1261 1261
     local project_dir=$1
1262 1262
 
1263 1263
     pip_install -e $project_dir
... ...
@@ -1271,7 +1271,7 @@ function setup_develop_no_requirements_update() {
1271 1271
 
1272 1272
 # remove extra commas from the input string (i.e. ``ENABLED_SERVICES``)
1273 1273
 # _cleanup_service_list service-list
1274
-function _cleanup_service_list () {
1274
+function _cleanup_service_list {
1275 1275
     echo "$1" | sed -e '
1276 1276
         s/,,/,/g;
1277 1277
         s/^,//;
... ...
@@ -1284,7 +1284,7 @@ function _cleanup_service_list () {
1284 1284
 # before a minimal installation
1285 1285
 # Uses global ``ENABLED_SERVICES``
1286 1286
 # disable_all_services
1287
-function disable_all_services() {
1287
+function disable_all_services {
1288 1288
     ENABLED_SERVICES=""
1289 1289
 }
1290 1290
 
... ...
@@ -1293,7 +1293,7 @@ function disable_all_services() {
1293 1293
 # ENABLED_SERVICES+=",-rabbit"
1294 1294
 # Uses global ``ENABLED_SERVICES``
1295 1295
 # disable_negated_services
1296
-function disable_negated_services() {
1296
+function disable_negated_services {
1297 1297
     local tmpsvcs="${ENABLED_SERVICES}"
1298 1298
     local service
1299 1299
     for service in ${tmpsvcs//,/ }; do
... ...
@@ -1314,7 +1314,7 @@ function disable_negated_services() {
1314 1314
 # for nova, glance, and neutron built into is_service_enabled().
1315 1315
 # Uses global ``ENABLED_SERVICES``
1316 1316
 # disable_service service [service ...]
1317
-function disable_service() {
1317
+function disable_service {
1318 1318
     local tmpsvcs=",${ENABLED_SERVICES},"
1319 1319
     local service
1320 1320
     for service in $@; do
... ...
@@ -1335,7 +1335,7 @@ function disable_service() {
1335 1335
 # for nova, glance, and neutron built into is_service_enabled().
1336 1336
 # Uses global ``ENABLED_SERVICES``
1337 1337
 # enable_service service [service ...]
1338
-function enable_service() {
1338
+function enable_service {
1339 1339
     local tmpsvcs="${ENABLED_SERVICES}"
1340 1340
     for service in $@; do
1341 1341
         if ! is_service_enabled $service; then
... ...
@@ -1369,7 +1369,7 @@ function enable_service() {
1369 1369
 #
1370 1370
 # Uses global ``ENABLED_SERVICES``
1371 1371
 # is_service_enabled service [service ...]
1372
-function is_service_enabled() {
1372
+function is_service_enabled {
1373 1373
     local xtrace=$(set +o | grep xtrace)
1374 1374
     set +o xtrace
1375 1375
     local enabled=1
... ...
@@ -1424,7 +1424,7 @@ function use_exclusive_service {
1424 1424
 
1425 1425
 # Only run the command if the target file (the last arg) is not on an
1426 1426
 # NFS filesystem.
1427
-function _safe_permission_operation() {
1427
+function _safe_permission_operation {
1428 1428
     local xtrace=$(set +o | grep xtrace)
1429 1429
     set +o xtrace
1430 1430
     local args=( $@ )
... ...
@@ -1457,7 +1457,7 @@ function _safe_permission_operation() {
1457 1457
 # Exit 0 if address is in network or 1 if address is not in network
1458 1458
 # ip-range is in CIDR notation: 1.2.3.4/20
1459 1459
 # address_in_net ip-address ip-range
1460
-function address_in_net() {
1460
+function address_in_net {
1461 1461
     local ip=$1
1462 1462
     local range=$2
1463 1463
     local masklen=${range#*/}
... ...
@@ -1468,7 +1468,7 @@ function address_in_net() {
1468 1468
 
1469 1469
 # Add a user to a group.
1470 1470
 # add_user_to_group user group
1471
-function add_user_to_group() {
1471
+function add_user_to_group {
1472 1472
     local user=$1
1473 1473
     local group=$2
1474 1474
 
... ...
@@ -1486,7 +1486,7 @@ function add_user_to_group() {
1486 1486
 
1487 1487
 # Convert CIDR notation to a IPv4 netmask
1488 1488
 # cidr2netmask cidr-bits
1489
-function cidr2netmask() {
1489
+function cidr2netmask {
1490 1490
     local maskpat="255 255 255 255"
1491 1491
     local maskdgt="254 252 248 240 224 192 128"
1492 1492
     set -- ${maskpat:0:$(( ($1 / 8) * 4 ))}${maskdgt:$(( (7 - ($1 % 8)) * 4 )):3}
... ...
@@ -1509,7 +1509,7 @@ function cp_it {
1509 1509
 #
1510 1510
 #     http_proxy=http://proxy.example.com:3128/ no_proxy=repo.example.net ./stack.sh
1511 1511
 
1512
-function export_proxy_variables() {
1512
+function export_proxy_variables {
1513 1513
     if [[ -n "$http_proxy" ]]; then
1514 1514
         export http_proxy=$http_proxy
1515 1515
     fi
... ...
@@ -1522,7 +1522,7 @@ function export_proxy_variables() {
1522 1522
 }
1523 1523
 
1524 1524
 # Returns true if the directory is on a filesystem mounted via NFS.
1525
-function is_nfs_directory() {
1525
+function is_nfs_directory {
1526 1526
     local mount_type=`stat -f -L -c %T $1`
1527 1527
     test "$mount_type" == "nfs"
1528 1528
 }
... ...
@@ -1530,7 +1530,7 @@ function is_nfs_directory() {
1530 1530
 # Return the network portion of the given IP address using netmask
1531 1531
 # netmask is in the traditional dotted-quad format
1532 1532
 # maskip ip-address netmask
1533
-function maskip() {
1533
+function maskip {
1534 1534
     local ip=$1
1535 1535
     local mask=$2
1536 1536
     local l="${ip%.*}"; local r="${ip#*.}"; local n="${mask%.*}"; local m="${mask#*.}"
... ...
@@ -1540,7 +1540,7 @@ function maskip() {
1540 1540
 
1541 1541
 # Service wrapper to restart services
1542 1542
 # restart_service service-name
1543
-function restart_service() {
1543
+function restart_service {
1544 1544
     if is_ubuntu; then
1545 1545
         sudo /usr/sbin/service $1 restart
1546 1546
     else
... ...
@@ -1550,19 +1550,19 @@ function restart_service() {
1550 1550
 
1551 1551
 # Only change permissions of a file or directory if it is not on an
1552 1552
 # NFS filesystem.
1553
-function safe_chmod() {
1553
+function safe_chmod {
1554 1554
     _safe_permission_operation chmod $@
1555 1555
 }
1556 1556
 
1557 1557
 # Only change ownership of a file or directory if it is not on an NFS
1558 1558
 # filesystem.
1559
-function safe_chown() {
1559
+function safe_chown {
1560 1560
     _safe_permission_operation chown $@
1561 1561
 }
1562 1562
 
1563 1563
 # Service wrapper to start services
1564 1564
 # start_service service-name
1565
-function start_service() {
1565
+function start_service {
1566 1566
     if is_ubuntu; then
1567 1567
         sudo /usr/sbin/service $1 start
1568 1568
     else
... ...
@@ -1572,7 +1572,7 @@ function start_service() {
1572 1572
 
1573 1573
 # Service wrapper to stop services
1574 1574
 # stop_service service-name
1575
-function stop_service() {
1575
+function stop_service {
1576 1576
     if is_ubuntu; then
1577 1577
         sudo /usr/sbin/service $1 stop
1578 1578
     else
... ...
@@ -50,7 +50,7 @@ fi
50 50
 #
51 51
 # Uses global ``APACHE_ENABLED_SERVICES``
52 52
 # APACHE_ENABLED_SERVICES service [service ...]
53
-function is_apache_enabled_service() {
53
+function is_apache_enabled_service {
54 54
     services=$@
55 55
     for service in ${services}; do
56 56
         [[ ,${APACHE_ENABLED_SERVICES}, =~ ,${service}, ]] && return 0
... ...
@@ -59,7 +59,7 @@ function is_apache_enabled_service() {
59 59
 }
60 60
 
61 61
 # install_apache_wsgi() - Install Apache server and wsgi module
62
-function install_apache_wsgi() {
62
+function install_apache_wsgi {
63 63
     # Apache installation, because we mark it NOPRIME
64 64
     if is_ubuntu; then
65 65
         # Install apache2, which is NOPRIME'd
... ...
@@ -79,7 +79,7 @@ function install_apache_wsgi() {
79 79
 }
80 80
 
81 81
 # enable_apache_site() - Enable a particular apache site
82
-function enable_apache_site() {
82
+function enable_apache_site {
83 83
     local site=$@
84 84
     if is_ubuntu; then
85 85
         sudo a2ensite ${site}
... ...
@@ -90,7 +90,7 @@ function enable_apache_site() {
90 90
 }
91 91
 
92 92
 # disable_apache_site() - Disable a particular apache site
93
-function disable_apache_site() {
93
+function disable_apache_site {
94 94
     local site=$@
95 95
     if is_ubuntu; then
96 96
         sudo a2dissite ${site}
... ...
@@ -100,12 +100,12 @@ function disable_apache_site() {
100 100
 }
101 101
 
102 102
 # start_apache_server() - Start running apache server
103
-function start_apache_server() {
103
+function start_apache_server {
104 104
     start_service $APACHE_NAME
105 105
 }
106 106
 
107 107
 # stop_apache_server() - Stop running apache server
108
-function stop_apache_server() {
108
+function stop_apache_server {
109 109
     if [ -n "$APACHE_NAME" ]; then
110 110
         stop_service $APACHE_NAME
111 111
     else
... ...
@@ -114,7 +114,7 @@ function stop_apache_server() {
114 114
 }
115 115
 
116 116
 # restart_apache_server
117
-function restart_apache_server() {
117
+function restart_apache_server {
118 118
     restart_service $APACHE_NAME
119 119
 }
120 120
 
... ...
@@ -166,7 +166,7 @@ BM_SHELL_IN_A_BOX=${BM_SHELL_IN_A_BOX:-http://shellinabox.googlecode.com/files/s
166 166
 # Check if baremetal is properly enabled
167 167
 # Returns false if VIRT_DRIVER is not baremetal, or if ENABLED_SERVICES
168 168
 # does not contain "baremetal"
169
-function is_baremetal() {
169
+function is_baremetal {
170 170
     if [[ "$ENABLED_SERVICES" =~ 'baremetal' && "$VIRT_DRIVER" = 'baremetal' ]]; then
171 171
         return 0
172 172
     fi
... ...
@@ -175,7 +175,7 @@ function is_baremetal() {
175 175
 
176 176
 # Install diskimage-builder and shell-in-a-box
177 177
 # so that we can build the deployment kernel & ramdisk
178
-function prepare_baremetal_toolchain() {
178
+function prepare_baremetal_toolchain {
179 179
     git_clone $BM_IMAGE_BUILD_REPO $BM_IMAGE_BUILD_DIR $BM_IMAGE_BUILD_BRANCH
180 180
     git_clone $BM_POSEUR_REPO $BM_POSEUR_DIR $BM_POSEUR_BRANCH
181 181
 
... ...
@@ -197,7 +197,7 @@ function prepare_baremetal_toolchain() {
197 197
 }
198 198
 
199 199
 # set up virtualized environment for devstack-gate testing
200
-function create_fake_baremetal_env() {
200
+function create_fake_baremetal_env {
201 201
     local bm_poseur="$BM_POSEUR_DIR/bm_poseur"
202 202
     # TODO(deva): add support for >1 VM
203 203
     sudo $bm_poseur $BM_POSEUR_EXTRA_OPTS create-bridge
... ...
@@ -211,14 +211,14 @@ function create_fake_baremetal_env() {
211 211
     BM_SECOND_MAC='12:34:56:78:90:12'
212 212
 }
213 213
 
214
-function cleanup_fake_baremetal_env() {
214
+function cleanup_fake_baremetal_env {
215 215
     local bm_poseur="$BM_POSEUR_DIR/bm_poseur"
216 216
     sudo $bm_poseur $BM_POSEUR_EXTRA_OPTS destroy-vm
217 217
     sudo $bm_poseur $BM_POSEUR_EXTRA_OPTS destroy-bridge
218 218
 }
219 219
 
220 220
 # prepare various directories needed by baremetal hypervisor
221
-function configure_baremetal_nova_dirs() {
221
+function configure_baremetal_nova_dirs {
222 222
     # ensure /tftpboot is prepared
223 223
     sudo mkdir -p /tftpboot
224 224
     sudo mkdir -p /tftpboot/pxelinux.cfg
... ...
@@ -249,7 +249,7 @@ function configure_baremetal_nova_dirs() {
249 249
 
250 250
 # build deploy kernel+ramdisk, then upload them to glance
251 251
 # this function sets BM_DEPLOY_KERNEL_ID and BM_DEPLOY_RAMDISK_ID
252
-function upload_baremetal_deploy() {
252
+function upload_baremetal_deploy {
253 253
     token=$1
254 254
 
255 255
     if [ "$BM_BUILD_DEPLOY_RAMDISK" = "True" ]; then
... ...
@@ -281,7 +281,7 @@ function upload_baremetal_deploy() {
281 281
 # create a basic baremetal flavor, associated with deploy kernel & ramdisk
282 282
 #
283 283
 # Usage: create_baremetal_flavor <aki_uuid> <ari_uuid>
284
-function create_baremetal_flavor() {
284
+function create_baremetal_flavor {
285 285
     aki=$1
286 286
     ari=$2
287 287
     nova flavor-create $BM_FLAVOR_NAME $BM_FLAVOR_ID \
... ...
@@ -298,7 +298,7 @@ function create_baremetal_flavor() {
298 298
 # Sets KERNEL_ID and RAMDISK_ID
299 299
 #
300 300
 # Usage: extract_and_upload_k_and_r_from_image $token $file
301
-function extract_and_upload_k_and_r_from_image() {
301
+function extract_and_upload_k_and_r_from_image {
302 302
     token=$1
303 303
     file=$2
304 304
     image_name=$(basename "$file" ".qcow2")
... ...
@@ -339,7 +339,7 @@ function extract_and_upload_k_and_r_from_image() {
339 339
 # Takes the same parameters, but has some peculiarities which made it
340 340
 # easier to create a separate method, rather than complicate the logic
341 341
 # of the existing function.
342
-function upload_baremetal_image() {
342
+function upload_baremetal_image {
343 343
     local image_url=$1
344 344
     local token=$2
345 345
 
... ...
@@ -429,7 +429,7 @@ function upload_baremetal_image() {
429 429
     DEFAULT_IMAGE_NAME="${IMAGE_NAME%.img}"
430 430
 }
431 431
 
432
-function clear_baremetal_of_all_nodes() {
432
+function clear_baremetal_of_all_nodes {
433 433
     list=$(nova baremetal-node-list | awk -F '| ' 'NR>3 {print $2}' )
434 434
     for node in $list; do
435 435
         nova baremetal-node-delete $node
... ...
@@ -440,7 +440,7 @@ function clear_baremetal_of_all_nodes() {
440 440
 # Defaults to using BM_FIRST_MAC and BM_SECOND_MAC if parameters not specified
441 441
 #
442 442
 # Usage: add_baremetal_node <first_mac> <second_mac>
443
-function add_baremetal_node() {
443
+function add_baremetal_node {
444 444
     mac_1=${1:-$BM_FIRST_MAC}
445 445
     mac_2=${2:-$BM_SECOND_MAC}
446 446
 
... ...
@@ -105,18 +105,18 @@ create_ceilometer_accounts() {
105 105
 
106 106
 # cleanup_ceilometer() - Remove residual data files, anything left over from previous
107 107
 # runs that a clean run would need to clean up
108
-function cleanup_ceilometer() {
108
+function cleanup_ceilometer {
109 109
     mongo ceilometer --eval "db.dropDatabase();"
110 110
 }
111 111
 
112 112
 # configure_ceilometerclient() - Set config files, create data dirs, etc
113
-function configure_ceilometerclient() {
113
+function configure_ceilometerclient {
114 114
     setup_develop $CEILOMETERCLIENT_DIR
115 115
     sudo install -D -m 0644 -o $STACK_USER {$CEILOMETERCLIENT_DIR/tools/,/etc/bash_completion.d/}ceilometer.bash_completion
116 116
 }
117 117
 
118 118
 # configure_ceilometer() - Set config files, create data dirs, etc
119
-function configure_ceilometer() {
119
+function configure_ceilometer {
120 120
     setup_develop $CEILOMETER_DIR
121 121
 
122 122
     [ ! -d $CEILOMETER_CONF_DIR ] && sudo mkdir -m 755 -p $CEILOMETER_CONF_DIR
... ...
@@ -162,7 +162,7 @@ function configure_ceilometer() {
162 162
     fi
163 163
 }
164 164
 
165
-function configure_mongodb() {
165
+function configure_mongodb {
166 166
     if is_fedora; then
167 167
         # install mongodb client
168 168
         install_package mongodb
... ...
@@ -174,7 +174,7 @@ function configure_mongodb() {
174 174
 }
175 175
 
176 176
 # init_ceilometer() - Initialize etc.
177
-function init_ceilometer() {
177
+function init_ceilometer {
178 178
     # Create cache dir
179 179
     sudo mkdir -p $CEILOMETER_AUTH_CACHE_DIR
180 180
     sudo chown $STACK_USER $CEILOMETER_AUTH_CACHE_DIR
... ...
@@ -187,17 +187,17 @@ function init_ceilometer() {
187 187
 }
188 188
 
189 189
 # install_ceilometer() - Collect source and prepare
190
-function install_ceilometer() {
190
+function install_ceilometer {
191 191
     git_clone $CEILOMETER_REPO $CEILOMETER_DIR $CEILOMETER_BRANCH
192 192
 }
193 193
 
194 194
 # install_ceilometerclient() - Collect source and prepare
195
-function install_ceilometerclient() {
195
+function install_ceilometerclient {
196 196
     git_clone $CEILOMETERCLIENT_REPO $CEILOMETERCLIENT_DIR $CEILOMETERCLIENT_BRANCH
197 197
 }
198 198
 
199 199
 # start_ceilometer() - Start running processes, including screen
200
-function start_ceilometer() {
200
+function start_ceilometer {
201 201
     if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
202 202
         screen_it ceilometer-acompute "cd ; sg $LIBVIRT_GROUP \"ceilometer-agent-compute --config-file $CEILOMETER_CONF\""
203 203
     fi
... ...
@@ -216,7 +216,7 @@ function start_ceilometer() {
216 216
 }
217 217
 
218 218
 # stop_ceilometer() - Stop running processes
219
-function stop_ceilometer() {
219
+function stop_ceilometer {
220 220
     # Kill the ceilometer screen windows
221 221
     for serv in ceilometer-acompute ceilometer-acentral ceilometer-anotification ceilometer-collector ceilometer-api ceilometer-alarm-notifier ceilometer-alarm-evaluator; do
222 222
         screen_stop $serv
... ...
@@ -102,7 +102,7 @@ function is_cinder_enabled {
102 102
 # _clean_lvm_lv removes all cinder LVM volumes
103 103
 #
104 104
 # Usage: _clean_lvm_lv $VOLUME_GROUP $VOLUME_NAME_PREFIX
105
-function _clean_lvm_lv() {
105
+function _clean_lvm_lv {
106 106
     local vg=$1
107 107
     local lv_prefix=$2
108 108
 
... ...
@@ -119,7 +119,7 @@ function _clean_lvm_lv() {
119 119
 # volume group used by cinder
120 120
 #
121 121
 # Usage: _clean_lvm_backing_file() $VOLUME_GROUP
122
-function _clean_lvm_backing_file() {
122
+function _clean_lvm_backing_file {
123 123
     local vg=$1
124 124
 
125 125
     # if there is no logical volume left, it's safe to attempt a cleanup
... ...
@@ -136,7 +136,7 @@ function _clean_lvm_backing_file() {
136 136
 
137 137
 # cleanup_cinder() - Remove residual data files, anything left over from previous
138 138
 # runs that a clean run would need to clean up
139
-function cleanup_cinder() {
139
+function cleanup_cinder {
140 140
     # ensure the volume group is cleared up because fails might
141 141
     # leave dead volumes in the group
142 142
     TARGETS=$(sudo tgtadm --op show --mode target)
... ...
@@ -181,7 +181,7 @@ function cleanup_cinder() {
181 181
 }
182 182
 
183 183
 # configure_cinder_rootwrap() - configure Cinder's rootwrap
184
-function configure_cinder_rootwrap() {
184
+function configure_cinder_rootwrap {
185 185
     # Set the paths of certain binaries
186 186
     CINDER_ROOTWRAP=$(get_rootwrap_location cinder)
187 187
 
... ...
@@ -212,7 +212,7 @@ function configure_cinder_rootwrap() {
212 212
 }
213 213
 
214 214
 # configure_cinder() - Set config files, create data dirs, etc
215
-function configure_cinder() {
215
+function configure_cinder {
216 216
     if [[ ! -d $CINDER_CONF_DIR ]]; then
217 217
         sudo mkdir -p $CINDER_CONF_DIR
218 218
     fi
... ...
@@ -328,7 +328,7 @@ function configure_cinder() {
328 328
 # service              cinder     admin        # if enabled
329 329
 
330 330
 # Migrated from keystone_data.sh
331
-create_cinder_accounts() {
331
+function create_cinder_accounts {
332 332
 
333 333
     SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
334 334
     ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
... ...
@@ -373,14 +373,14 @@ create_cinder_accounts() {
373 373
 }
374 374
 
375 375
 # create_cinder_cache_dir() - Part of the init_cinder() process
376
-function create_cinder_cache_dir() {
376
+function create_cinder_cache_dir {
377 377
     # Create cache dir
378 378
     sudo mkdir -p $CINDER_AUTH_CACHE_DIR
379 379
     sudo chown $STACK_USER $CINDER_AUTH_CACHE_DIR
380 380
     rm -f $CINDER_AUTH_CACHE_DIR/*
381 381
 }
382 382
 
383
-create_cinder_volume_group() {
383
+function create_cinder_volume_group {
384 384
     # According to the ``CINDER_MULTI_LVM_BACKEND`` value, configure one or two default volumes
385 385
     # group called ``stack-volumes`` (and ``stack-volumes2``) for the volume
386 386
     # service if it (they) does (do) not yet exist. If you don't wish to use a
... ...
@@ -428,7 +428,7 @@ create_cinder_volume_group() {
428 428
 }
429 429
 
430 430
 # init_cinder() - Initialize database and volume group
431
-function init_cinder() {
431
+function init_cinder {
432 432
     # Force nova volumes off
433 433
     NOVA_ENABLED_APIS=$(echo $NOVA_ENABLED_APIS | sed "s/osapi_volume,//")
434 434
 
... ...
@@ -464,20 +464,20 @@ function init_cinder() {
464 464
 }
465 465
 
466 466
 # install_cinder() - Collect source and prepare
467
-function install_cinder() {
467
+function install_cinder {
468 468
     git_clone $CINDER_REPO $CINDER_DIR $CINDER_BRANCH
469 469
     setup_develop $CINDER_DIR
470 470
 }
471 471
 
472 472
 # install_cinderclient() - Collect source and prepare
473
-function install_cinderclient() {
473
+function install_cinderclient {
474 474
     git_clone $CINDERCLIENT_REPO $CINDERCLIENT_DIR $CINDERCLIENT_BRANCH
475 475
     setup_develop $CINDERCLIENT_DIR
476 476
     sudo install -D -m 0644 -o $STACK_USER {$CINDERCLIENT_DIR/tools/,/etc/bash_completion.d/}cinder.bash_completion
477 477
 }
478 478
 
479 479
 # apply config.d approach for cinder volumes directory
480
-function _configure_tgt_for_config_d() {
480
+function _configure_tgt_for_config_d {
481 481
     if [[ ! -d /etc/tgt/stack.d/ ]]; then
482 482
         sudo ln -sf $CINDER_STATE_PATH/volumes /etc/tgt/stack.d
483 483
         echo "include /etc/tgt/stack.d/*" | sudo tee -a /etc/tgt/targets.conf
... ...
@@ -485,7 +485,7 @@ function _configure_tgt_for_config_d() {
485 485
 }
486 486
 
487 487
 # start_cinder() - Start running processes, including screen
488
-function start_cinder() {
488
+function start_cinder {
489 489
     if is_service_enabled c-vol; then
490 490
         # Delete any old stack.conf
491 491
         sudo rm -f /etc/tgt/conf.d/stack.conf
... ...
@@ -529,7 +529,7 @@ function start_cinder() {
529 529
 }
530 530
 
531 531
 # stop_cinder() - Stop running processes
532
-function stop_cinder() {
532
+function stop_cinder {
533 533
     # Kill the cinder screen windows
534 534
     for serv in c-api c-bak c-sch c-vol; do
535 535
         screen_stop $serv
... ...
@@ -27,7 +27,7 @@ set +o xtrace
27 27
 # ------------
28 28
 
29 29
 # configure_cinder_driver - Set config files, create data dirs, etc
30
-function configure_cinder_driver() {
30
+function configure_cinder_driver {
31 31
     iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.xenapi.sm.XenAPINFSDriver"
32 32
     iniset $CINDER_CONF DEFAULT xenapi_connection_url "$CINDER_XENAPI_CONNECTION_URL"
33 33
     iniset $CINDER_CONF DEFAULT xenapi_connection_username "$CINDER_XENAPI_CONNECTION_USERNAME"
... ...
@@ -27,7 +27,7 @@ set +o xtrace
27 27
 # ------------
28 28
 
29 29
 # configure_cinder_driver - Set config files, create data dirs, etc
30
-function configure_cinder_driver() {
30
+function configure_cinder_driver {
31 31
     # To use glusterfs, set the following in localrc:
32 32
     # CINDER_DRIVER=glusterfs
33 33
     # CINDER_GLUSTERFS_SHARES="127.0.0.1:/vol1;127.0.0.1:/vol2"
... ...
@@ -27,7 +27,7 @@ set +o xtrace
27 27
 # ------------
28 28
 
29 29
 # configure_cinder_driver - Set config files, create data dirs, etc
30
-function configure_cinder_driver() {
30
+function configure_cinder_driver {
31 31
     iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.nfs.NfsDriver"
32 32
     iniset $CINDER_CONF DEFAULT nfs_shares_config "$CINDER_CONF_DIR/nfs_shares.conf"
33 33
     echo "$CINDER_NFS_SERVERPATH" | sudo tee "$CINDER_CONF_DIR/nfs_shares.conf"
... ...
@@ -27,7 +27,7 @@ set +o xtrace
27 27
 # ------------
28 28
 
29 29
 # configure_cinder_driver - Set config files, create data dirs, etc
30
-function configure_cinder_driver() {
30
+function configure_cinder_driver {
31 31
     iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.sheepdog.SheepdogDriver"
32 32
 }
33 33
 
... ...
@@ -27,7 +27,7 @@ set +o xtrace
27 27
 # ------------
28 28
 
29 29
 # configure_cinder_driver - Set config files, create data dirs, etc
30
-function configure_cinder_driver() {
30
+function configure_cinder_driver {
31 31
     # To use solidfire, set the following in localrc:
32 32
     # CINDER_DRIVER=solidfire
33 33
     # SAN_IP=<mvip>
... ...
@@ -27,7 +27,7 @@ set +o xtrace
27 27
 # ------------
28 28
 
29 29
 # configure_cinder_driver - Set config files, create data dirs, etc
30
-function configure_cinder_driver() {
30
+function configure_cinder_driver {
31 31
     iniset $CINDER_CONF DEFAULT vmware_host_ip "$VMWAREAPI_IP"
32 32
     iniset $CINDER_CONF DEFAULT vmware_host_username "$VMWAREAPI_USER"
33 33
     iniset $CINDER_CONF DEFAULT vmware_host_password "$VMWAREAPI_PASSWORD"
... ...
@@ -25,7 +25,7 @@ CONFIG_AWK_CMD=${CONFIG_AWK_CMD:-awk}
25 25
 
26 26
 # Get the section for the specific group and config file
27 27
 # get_meta_section infile group configfile
28
-function get_meta_section() {
28
+function get_meta_section {
29 29
     local file=$1
30 30
     local matchgroup=$2
31 31
     local configfile=$3
... ...
@@ -57,7 +57,7 @@ function get_meta_section() {
57 57
 
58 58
 # Get a list of config files for a specific group
59 59
 # get_meta_section_files infile group
60
-function get_meta_section_files() {
60
+function get_meta_section_files {
61 61
     local file=$1
62 62
     local matchgroup=$2
63 63
 
... ...
@@ -77,7 +77,7 @@ function get_meta_section_files() {
77 77
 # Merge the contents of a meta-config file into its destination config file
78 78
 # If configfile does not exist it will be created.
79 79
 # merge_config_file infile group configfile
80
-function merge_config_file() {
80
+function merge_config_file {
81 81
     local file=$1
82 82
     local matchgroup=$2
83 83
     local configfile=$3
... ...
@@ -106,7 +106,7 @@ function merge_config_file() {
106 106
 
107 107
 # Merge all of the files specified by group
108 108
 # merge_config_group infile group [group ...]
109
-function merge_config_group() {
109
+function merge_config_group {
110 110
     local localfile=$1; shift
111 111
     local matchgroups=$@
112 112
 
... ...
@@ -47,42 +47,42 @@ GANTT_BIN_DIR=$(get_python_exec_prefix)
47 47
 
48 48
 # cleanup_gantt() - Remove residual data files, anything left over from previous
49 49
 # runs that a clean run would need to clean up
50
-function cleanup_gantt() {
50
+function cleanup_gantt {
51 51
     echo "Cleanup Gantt"
52 52
 }
53 53
 
54 54
 # configure_gantt() - Set config files, create data dirs, etc
55
-function configure_gantt() {
55
+function configure_gantt {
56 56
     echo "Configure Gantt"
57 57
 }
58 58
 
59 59
 # init_gantt() - Initialize database and volume group
60
-function init_gantt() {
60
+function init_gantt {
61 61
     echo "Initialize Gantt"
62 62
 }
63 63
 
64 64
 # install_gantt() - Collect source and prepare
65
-function install_gantt() {
65
+function install_gantt {
66 66
     git_clone $GANTT_REPO $GANTT_DIR $GANTT_BRANCH
67 67
     setup_develop $GANTT_DIR
68 68
 }
69 69
 
70 70
 # install_ganttclient() - Collect source and prepare
71
-function install_ganttclient() {
71
+function install_ganttclient {
72 72
     echo "Install Gantt Client"
73 73
 #    git_clone $GANTTCLIENT_REPO $GANTTCLIENT_DIR $GANTTCLIENT_BRANCH
74 74
 #    setup_develop $GANTTCLIENT_DIR
75 75
 }
76 76
 
77 77
 # start_gantt() - Start running processes, including screen
78
-function start_gantt() {
78
+function start_gantt {
79 79
     if is_service_enabled gantt; then
80 80
         screen_it gantt "cd $GANTT_DIR && $GANTT_BIN_DIR/gantt-scheduler --config-file $GANTT_CONF"
81 81
     fi
82 82
 }
83 83
 
84 84
 # stop_gantt() - Stop running processes
85
-function stop_gantt() {
85
+function stop_gantt {
86 86
     echo "Stop Gantt"
87 87
     screen_stop gantt
88 88
 }
... ...
@@ -68,14 +68,14 @@ function is_glance_enabled {
68 68
 
69 69
 # cleanup_glance() - Remove residual data files, anything left over from previous
70 70
 # runs that a clean run would need to clean up
71
-function cleanup_glance() {
71
+function cleanup_glance {
72 72
     # kill instances (nova)
73 73
     # delete image files (glance)
74 74
     sudo rm -rf $GLANCE_CACHE_DIR $GLANCE_IMAGE_DIR $GLANCE_AUTH_CACHE_DIR
75 75
 }
76 76
 
77 77
 # configure_glance() - Set config files, create data dirs, etc
78
-function configure_glance() {
78
+function configure_glance {
79 79
     if [[ ! -d $GLANCE_CONF_DIR ]]; then
80 80
         sudo mkdir -p $GLANCE_CONF_DIR
81 81
     fi
... ...
@@ -160,7 +160,7 @@ function configure_glance() {
160 160
 }
161 161
 
162 162
 # create_glance_cache_dir() - Part of the init_glance() process
163
-function create_glance_cache_dir() {
163
+function create_glance_cache_dir {
164 164
     # Create cache dir
165 165
     sudo mkdir -p $GLANCE_AUTH_CACHE_DIR/api
166 166
     sudo chown $STACK_USER $GLANCE_AUTH_CACHE_DIR/api
... ...
@@ -171,7 +171,7 @@ function create_glance_cache_dir() {
171 171
 }
172 172
 
173 173
 # init_glance() - Initialize databases, etc.
174
-function init_glance() {
174
+function init_glance {
175 175
     # Delete existing images
176 176
     rm -rf $GLANCE_IMAGE_DIR
177 177
     mkdir -p $GLANCE_IMAGE_DIR
... ...
@@ -190,19 +190,19 @@ function init_glance() {
190 190
 }
191 191
 
192 192
 # install_glanceclient() - Collect source and prepare
193
-function install_glanceclient() {
193
+function install_glanceclient {
194 194
     git_clone $GLANCECLIENT_REPO $GLANCECLIENT_DIR $GLANCECLIENT_BRANCH
195 195
     setup_develop $GLANCECLIENT_DIR
196 196
 }
197 197
 
198 198
 # install_glance() - Collect source and prepare
199
-function install_glance() {
199
+function install_glance {
200 200
     git_clone $GLANCE_REPO $GLANCE_DIR $GLANCE_BRANCH
201 201
     setup_develop $GLANCE_DIR
202 202
 }
203 203
 
204 204
 # start_glance() - Start running processes, including screen
205
-function start_glance() {
205
+function start_glance {
206 206
     screen_it g-reg "cd $GLANCE_DIR; $GLANCE_BIN_DIR/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf"
207 207
     screen_it g-api "cd $GLANCE_DIR; $GLANCE_BIN_DIR/glance-api --config-file=$GLANCE_CONF_DIR/glance-api.conf"
208 208
     echo "Waiting for g-api ($GLANCE_HOSTPORT) to start..."
... ...
@@ -212,7 +212,7 @@ function start_glance() {
212 212
 }
213 213
 
214 214
 # stop_glance() - Stop running processes
215
-function stop_glance() {
215
+function stop_glance {
216 216
     # Kill the Glance screen windows
217 217
     screen_stop g-api
218 218
     screen_stop g-reg
... ...
@@ -47,14 +47,14 @@ TEMPEST_SERVICES+=,heat
47 47
 
48 48
 # cleanup_heat() - Remove residual data files, anything left over from previous
49 49
 # runs that a clean run would need to clean up
50
-function cleanup_heat() {
50
+function cleanup_heat {
51 51
     sudo rm -rf $HEAT_AUTH_CACHE_DIR
52 52
     sudo rm -rf $HEAT_ENV_DIR
53 53
     sudo rm -rf $HEAT_TEMPLATES_DIR
54 54
 }
55 55
 
56 56
 # configure_heat() - Set config files, create data dirs, etc
57
-function configure_heat() {
57
+function configure_heat {
58 58
     setup_develop $HEAT_DIR
59 59
 
60 60
     if [[ ! -d $HEAT_CONF_DIR ]]; then
... ...
@@ -137,7 +137,7 @@ function configure_heat() {
137 137
 }
138 138
 
139 139
 # init_heat() - Initialize database
140
-function init_heat() {
140
+function init_heat {
141 141
 
142 142
     # (re)create heat database
143 143
     recreate_database heat utf8
... ...
@@ -147,26 +147,26 @@ function init_heat() {
147 147
 }
148 148
 
149 149
 # create_heat_cache_dir() - Part of the init_heat() process
150
-function create_heat_cache_dir() {
150
+function create_heat_cache_dir {
151 151
     # Create cache dirs
152 152
     sudo mkdir -p $HEAT_AUTH_CACHE_DIR
153 153
     sudo chown $STACK_USER $HEAT_AUTH_CACHE_DIR
154 154
 }
155 155
 
156 156
 # install_heatclient() - Collect source and prepare
157
-function install_heatclient() {
157
+function install_heatclient {
158 158
     git_clone $HEATCLIENT_REPO $HEATCLIENT_DIR $HEATCLIENT_BRANCH
159 159
     setup_develop $HEATCLIENT_DIR
160 160
     sudo install -D -m 0644 -o $STACK_USER {$HEATCLIENT_DIR/tools/,/etc/bash_completion.d/}heat.bash_completion
161 161
 }
162 162
 
163 163
 # install_heat() - Collect source and prepare
164
-function install_heat() {
164
+function install_heat {
165 165
     git_clone $HEAT_REPO $HEAT_DIR $HEAT_BRANCH
166 166
 }
167 167
 
168 168
 # start_heat() - Start running processes, including screen
169
-function start_heat() {
169
+function start_heat {
170 170
     screen_it h-eng "cd $HEAT_DIR; bin/heat-engine --config-file=$HEAT_CONF"
171 171
     screen_it h-api "cd $HEAT_DIR; bin/heat-api --config-file=$HEAT_CONF"
172 172
     screen_it h-api-cfn "cd $HEAT_DIR; bin/heat-api-cfn --config-file=$HEAT_CONF"
... ...
@@ -174,7 +174,7 @@ function start_heat() {
174 174
 }
175 175
 
176 176
 # stop_heat() - Stop running processes
177
-function stop_heat() {
177
+function stop_heat {
178 178
     # Kill the screen windows
179 179
     for serv in h-eng h-api h-api-cfn h-api-cw; do
180 180
         screen_stop $serv
... ...
@@ -198,7 +198,7 @@ function disk_image_create {
198 198
 
199 199
 # create_heat_accounts() - Set up common required heat accounts
200 200
 # Note this is in addition to what is in files/keystone_data.sh
201
-function create_heat_accounts() {
201
+function create_heat_accounts {
202 202
     # Note we have to pass token/endpoint here because the current endpoint and
203 203
     # version negotiation in OSC means just --os-identity-api-version=3 won't work
204 204
     KS_ENDPOINT_V3="$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v3"
... ...
@@ -39,7 +39,7 @@ TEMPEST_SERVICES+=,horizon
39 39
 # ---------
40 40
 
41 41
 # utility method of setting python option
42
-function _horizon_config_set() {
42
+function _horizon_config_set {
43 43
     local file=$1
44 44
     local section=$2
45 45
     local option=$3
... ...
@@ -64,7 +64,7 @@ function _horizon_config_set() {
64 64
 
65 65
 # cleanup_horizon() - Remove residual data files, anything left over from previous
66 66
 # runs that a clean run would need to clean up
67
-function cleanup_horizon() {
67
+function cleanup_horizon {
68 68
     if [[ is_fedora && $DISTRO =~ (rhel6) ]]; then
69 69
         # If ``/usr/bin/node`` points into ``$DEST``
70 70
         # we installed it via ``install_nodejs``
... ...
@@ -75,12 +75,12 @@ function cleanup_horizon() {
75 75
 }
76 76
 
77 77
 # configure_horizon() - Set config files, create data dirs, etc
78
-function configure_horizon() {
78
+function configure_horizon {
79 79
     setup_develop $HORIZON_DIR
80 80
 }
81 81
 
82 82
 # init_horizon() - Initialize databases, etc.
83
-function init_horizon() {
83
+function init_horizon {
84 84
     # ``local_settings.py`` is used to override horizon default settings.
85 85
     local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py
86 86
     cp $HORIZON_SETTINGS $local_settings
... ...
@@ -143,7 +143,7 @@ function init_horizon() {
143 143
 }
144 144
 
145 145
 # install_horizon() - Collect source and prepare
146
-function install_horizon() {
146
+function install_horizon {
147 147
     # Apache installation, because we mark it NOPRIME
148 148
     install_apache_wsgi
149 149
 
... ...
@@ -151,13 +151,13 @@ function install_horizon() {
151 151
 }
152 152
 
153 153
 # start_horizon() - Start running processes, including screen
154
-function start_horizon() {
154
+function start_horizon {
155 155
     restart_apache_server
156 156
     screen_it horizon "cd $HORIZON_DIR && sudo tail -f /var/log/$APACHE_NAME/horizon_error.log"
157 157
 }
158 158
 
159 159
 # stop_horizon() - Stop running processes (non-screen)
160
-function stop_horizon() {
160
+function stop_horizon {
161 161
     stop_apache_server
162 162
 }
163 163
 
... ...
@@ -27,7 +27,7 @@ REQUIREMENTS_DIR=$DEST/requirements
27 27
 # ------------
28 28
 
29 29
 # unfubar_setuptools() - Unbreak the giant mess that is the current state of setuptools
30
-function unfubar_setuptools() {
30
+function unfubar_setuptools {
31 31
     # this is a giant game of who's on first, but it does consistently work
32 32
     # there is hope that upstream python packaging fixes this in the future
33 33
     echo_summary "Unbreaking setuptools"
... ...
@@ -40,7 +40,7 @@ function unfubar_setuptools() {
40 40
 
41 41
 
42 42
 # install_infra() - Collect source and prepare
43
-function install_infra() {
43
+function install_infra {
44 44
     # bring down global requirements
45 45
     git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH
46 46
 
... ...
@@ -57,25 +57,25 @@ function is_ironic_enabled {
57 57
 }
58 58
 
59 59
 # install_ironic() - Collect source and prepare
60
-function install_ironic() {
60
+function install_ironic {
61 61
     git_clone $IRONIC_REPO $IRONIC_DIR $IRONIC_BRANCH
62 62
     setup_develop $IRONIC_DIR
63 63
 }
64 64
 
65 65
 # install_ironicclient() - Collect sources and prepare
66
-function install_ironicclient() {
66
+function install_ironicclient {
67 67
     git_clone $IRONICCLIENT_REPO $IRONICCLIENT_DIR $IRONICCLIENT_BRANCH
68 68
     setup_develop $IRONICCLIENT_DIR
69 69
 }
70 70
 
71 71
 # cleanup_ironic() - Remove residual data files, anything left over from previous
72 72
 # runs that would need to clean up.
73
-function cleanup_ironic() {
73
+function cleanup_ironic {
74 74
     sudo rm -rf $IRONIC_AUTH_CACHE_DIR
75 75
 }
76 76
 
77 77
 # configure_ironic() - Set config files, create data dirs, etc
78
-function configure_ironic() {
78
+function configure_ironic {
79 79
     if [[ ! -d $IRONIC_CONF_DIR ]]; then
80 80
         sudo mkdir -p $IRONIC_CONF_DIR
81 81
     fi
... ...
@@ -101,7 +101,7 @@ function configure_ironic() {
101 101
 
102 102
 # configure_ironic_api() - Is used by configure_ironic(). Performs
103 103
 # API specific configuration.
104
-function configure_ironic_api() {
104
+function configure_ironic_api {
105 105
     iniset $IRONIC_CONF_FILE DEFAULT auth_strategy keystone
106 106
     iniset $IRONIC_CONF_FILE DEFAULT policy_file $IRONIC_POLICY_JSON
107 107
     iniset $IRONIC_CONF_FILE keystone_authtoken auth_host $KEYSTONE_AUTH_HOST
... ...
@@ -120,7 +120,7 @@ function configure_ironic_api() {
120 120
 
121 121
 # configure_ironic_conductor() - Is used by configure_ironic().
122 122
 # Sets conductor specific settings.
123
-function configure_ironic_conductor() {
123
+function configure_ironic_conductor {
124 124
     cp $IRONIC_DIR/etc/ironic/rootwrap.conf $IRONIC_ROOTWRAP_CONF
125 125
     cp -r $IRONIC_DIR/etc/ironic/rootwrap.d $IRONIC_CONF_DIR
126 126
 
... ...
@@ -128,7 +128,7 @@ function configure_ironic_conductor() {
128 128
 }
129 129
 
130 130
 # create_ironic_cache_dir() - Part of the init_ironic() process
131
-function create_ironic_cache_dir() {
131
+function create_ironic_cache_dir {
132 132
     # Create cache dir
133 133
     sudo mkdir -p $IRONIC_AUTH_CACHE_DIR/api
134 134
     sudo chown $STACK_USER $IRONIC_AUTH_CACHE_DIR/api
... ...
@@ -143,7 +143,7 @@ function create_ironic_cache_dir() {
143 143
 # Tenant               User       Roles
144 144
 # ------------------------------------------------------------------
145 145
 # service              ironic     admin        # if enabled
146
-create_ironic_accounts() {
146
+function create_ironic_accounts {
147 147
 
148 148
     SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
149 149
     ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
... ...
@@ -178,7 +178,7 @@ create_ironic_accounts() {
178 178
 
179 179
 
180 180
 # init_ironic() - Initialize databases, etc.
181
-function init_ironic() {
181
+function init_ironic {
182 182
     # (Re)create  ironic database
183 183
     recreate_database ironic utf8
184 184
 
... ...
@@ -192,7 +192,7 @@ function init_ironic() {
192 192
 }
193 193
 
194 194
 # start_ironic() - Start running processes, including screen
195
-function start_ironic() {
195
+function start_ironic {
196 196
     # Start Ironic API server, if enabled.
197 197
     if is_service_enabled ir-api; then
198 198
         start_ironic_api
... ...
@@ -206,7 +206,7 @@ function start_ironic() {
206 206
 
207 207
 # start_ironic_api() - Used by start_ironic().
208 208
 # Starts Ironic API server.
209
-function start_ironic_api() {
209
+function start_ironic_api {
210 210
     screen_it ir-api "cd $IRONIC_DIR; $IRONIC_BIN_DIR/ironic-api --config-file=$IRONIC_CONF_FILE"
211 211
     echo "Waiting for ir-api ($IRONIC_HOSTPORT) to start..."
212 212
     if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- http://$IRONIC_HOSTPORT; do sleep 1; done"; then
... ...
@@ -216,13 +216,13 @@ function start_ironic_api() {
216 216
 
217 217
 # start_ironic_conductor() - Used by start_ironic().
218 218
 # Starts Ironic conductor.
219
-function start_ironic_conductor() {
219
+function start_ironic_conductor {
220 220
     screen_it ir-cond "cd $IRONIC_DIR; $IRONIC_BIN_DIR/ironic-conductor --config-file=$IRONIC_CONF_FILE"
221 221
     # TODO(romcheg): Find a way to check whether the conductor has started.
222 222
 }
223 223
 
224 224
 # stop_ironic() - Stop running processes
225
-function stop_ironic() {
225
+function stop_ironic {
226 226
     # Kill the Ironic screen windows
227 227
     screen -S $SCREEN_NAME -p ir-api -X kill
228 228
     screen -S $SCREEN_NAME -p ir-cond -X kill
... ...
@@ -90,7 +90,7 @@ fi
90 90
 # ---------
91 91
 # cleanup_keystone() - Remove residual data files, anything left over from previous
92 92
 # runs that a clean run would need to clean up
93
-function cleanup_keystone() {
93
+function cleanup_keystone {
94 94
     # kill instances (nova)
95 95
     # delete image files (glance)
96 96
     # This function intentionally left blank
... ...
@@ -98,14 +98,14 @@ function cleanup_keystone() {
98 98
 }
99 99
 
100 100
 # _cleanup_keystone_apache_wsgi() - Remove wsgi files, disable and remove apache vhost file
101
-function _cleanup_keystone_apache_wsgi() {
101
+function _cleanup_keystone_apache_wsgi {
102 102
     sudo rm -f $KEYSTONE_WSGI_DIR/*.wsgi
103 103
     disable_apache_site keystone
104 104
     sudo rm -f /etc/$APACHE_NAME/$APACHE_CONF_DIR/keystone
105 105
 }
106 106
 
107 107
 # _config_keystone_apache_wsgi() - Set WSGI config files of Keystone
108
-function _config_keystone_apache_wsgi() {
108
+function _config_keystone_apache_wsgi {
109 109
     sudo mkdir -p $KEYSTONE_WSGI_DIR
110 110
 
111 111
     # copy proxy vhost and wsgi file
... ...
@@ -125,7 +125,7 @@ function _config_keystone_apache_wsgi() {
125 125
 }
126 126
 
127 127
 # configure_keystone() - Set config files, create data dirs, etc
128
-function configure_keystone() {
128
+function configure_keystone {
129 129
     if [[ ! -d $KEYSTONE_CONF_DIR ]]; then
130 130
         sudo mkdir -p $KEYSTONE_CONF_DIR
131 131
     fi
... ...
@@ -272,7 +272,7 @@ function configure_keystone() {
272 272
 # invisible_to_admin   demo       Member
273 273
 
274 274
 # Migrated from keystone_data.sh
275
-create_keystone_accounts() {
275
+function create_keystone_accounts {
276 276
 
277 277
     # admin
278 278
     ADMIN_TENANT=$(openstack project create \
... ...
@@ -346,14 +346,14 @@ create_keystone_accounts() {
346 346
 
347 347
 # Configure the API version for the OpenStack projects.
348 348
 # configure_API_version conf_file version
349
-function configure_API_version() {
349
+function configure_API_version {
350 350
     local conf_file=$1
351 351
     local api_version=$2
352 352
     iniset $conf_file keystone_authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v$api_version
353 353
 }
354 354
 
355 355
 # init_keystone() - Initialize databases, etc.
356
-function init_keystone() {
356
+function init_keystone {
357 357
     if is_service_enabled ldap; then
358 358
         init_ldap
359 359
     fi
... ...
@@ -377,14 +377,14 @@ function init_keystone() {
377 377
 }
378 378
 
379 379
 # install_keystoneclient() - Collect source and prepare
380
-function install_keystoneclient() {
380
+function install_keystoneclient {
381 381
     git_clone $KEYSTONECLIENT_REPO $KEYSTONECLIENT_DIR $KEYSTONECLIENT_BRANCH
382 382
     setup_develop $KEYSTONECLIENT_DIR
383 383
     sudo install -D -m 0644 -o $STACK_USER {$KEYSTONECLIENT_DIR/tools/,/etc/bash_completion.d/}keystone.bash_completion
384 384
 }
385 385
 
386 386
 # install_keystone() - Collect source and prepare
387
-function install_keystone() {
387
+function install_keystone {
388 388
     # only install ldap if the service has been enabled
389 389
     if is_service_enabled ldap; then
390 390
         install_ldap
... ...
@@ -408,7 +408,7 @@ function install_keystone() {
408 408
 }
409 409
 
410 410
 # start_keystone() - Start running processes, including screen
411
-function start_keystone() {
411
+function start_keystone {
412 412
     # Get right service port for testing
413 413
     local service_port=$KEYSTONE_SERVICE_PORT
414 414
     if is_service_enabled tls-proxy; then
... ...
@@ -436,7 +436,7 @@ function start_keystone() {
436 436
 }
437 437
 
438 438
 # stop_keystone() - Stop running processes
439
-function stop_keystone() {
439
+function stop_keystone {
440 440
     # Kill the Keystone screen window
441 441
     screen_stop key
442 442
 }
... ...
@@ -49,7 +49,7 @@ fi
49 49
 
50 50
 # Perform common variable substitutions on the data files
51 51
 # _ldap_varsubst file
52
-function _ldap_varsubst() {
52
+function _ldap_varsubst {
53 53
     local infile=$1
54 54
     sed -e "
55 55
         s|\${LDAP_OLCDB_NUMBER}|$LDAP_OLCDB_NUMBER|
... ...
@@ -62,7 +62,7 @@ function _ldap_varsubst() {
62 62
 }
63 63
 
64 64
 # clean_ldap() - Remove ldap server
65
-function cleanup_ldap() {
65
+function cleanup_ldap {
66 66
     uninstall_package $(get_packages ldap)
67 67
     if is_ubuntu; then
68 68
         uninstall_package slapd ldap-utils libslp1
... ...
@@ -76,7 +76,7 @@ function cleanup_ldap() {
76 76
 
77 77
 # init_ldap
78 78
 # init_ldap() - Initialize databases, etc.
79
-function init_ldap() {
79
+function init_ldap {
80 80
     local keystone_ldif
81 81
 
82 82
     TMP_LDAP_DIR=$(mktemp -d -t ldap.$$.XXXXXXXXXX)
... ...
@@ -106,7 +106,7 @@ function init_ldap() {
106 106
 
107 107
 # install_ldap
108 108
 # install_ldap() - Collect source and prepare
109
-function install_ldap() {
109
+function install_ldap {
110 110
     echo "Installing LDAP inside function"
111 111
     echo "os_VENDOR is $os_VENDOR"
112 112
 
... ...
@@ -143,17 +143,17 @@ function install_ldap() {
143 143
 }
144 144
 
145 145
 # start_ldap() - Start LDAP
146
-function start_ldap() {
146
+function start_ldap {
147 147
     sudo service $LDAP_SERVICE_NAME restart
148 148
 }
149 149
 
150 150
 # stop_ldap() - Stop LDAP
151
-function stop_ldap() {
151
+function stop_ldap {
152 152
     sudo service $LDAP_SERVICE_NAME stop
153 153
 }
154 154
 
155 155
 # clear_ldap_state() - Clear LDAP State
156
-function clear_ldap_state() {
156
+function clear_ldap_state {
157 157
     ldapdelete -x -w $LDAP_PASSWORD -D "$LDAP_MANAGER_DN" -H $LDAP_URL -r "$LDAP_BASE_DN"
158 158
 }
159 159
 
... ...
@@ -73,19 +73,19 @@ function is_marconi_enabled {
73 73
 
74 74
 # cleanup_marconi() - Remove residual data files, anything left over from previous
75 75
 # runs that a clean run would need to clean up
76
-function cleanup_marconi() {
76
+function cleanup_marconi {
77 77
     if ! timeout $SERVICE_TIMEOUT sh -c "while ! mongo marconi --eval 'db.dropDatabase();'; do sleep 1; done"; then
78 78
         die $LINENO "Mongo DB did not start"
79 79
     fi
80 80
 }
81 81
 
82 82
 # configure_marconiclient() - Set config files, create data dirs, etc
83
-function configure_marconiclient() {
83
+function configure_marconiclient {
84 84
     setup_develop $MARCONICLIENT_DIR
85 85
 }
86 86
 
87 87
 # configure_marconi() - Set config files, create data dirs, etc
88
-function configure_marconi() {
88
+function configure_marconi {
89 89
     setup_develop $MARCONI_DIR
90 90
 
91 91
     [ ! -d $MARCONI_CONF_DIR ] && sudo mkdir -m 755 -p $MARCONI_CONF_DIR
... ...
@@ -110,7 +110,7 @@ function configure_marconi() {
110 110
     fi
111 111
 }
112 112
 
113
-function configure_mongodb() {
113
+function configure_mongodb {
114 114
     # Set nssize to 2GB. This increases the number of namespaces supported
115 115
     # # per database.
116 116
     if is_ubuntu; then
... ...
@@ -126,7 +126,7 @@ function configure_mongodb() {
126 126
 }
127 127
 
128 128
 # init_marconi() - Initialize etc.
129
-function init_marconi() {
129
+function init_marconi {
130 130
     # Create cache dir
131 131
     sudo mkdir -p $MARCONI_AUTH_CACHE_DIR
132 132
     sudo chown $STACK_USER $MARCONI_AUTH_CACHE_DIR
... ...
@@ -134,19 +134,19 @@ function init_marconi() {
134 134
 }
135 135
 
136 136
 # install_marconi() - Collect source and prepare
137
-function install_marconi() {
137
+function install_marconi {
138 138
     git_clone $MARCONI_REPO $MARCONI_DIR $MARCONI_BRANCH
139 139
     setup_develop $MARCONI_DIR
140 140
 }
141 141
 
142 142
 # install_marconiclient() - Collect source and prepare
143
-function install_marconiclient() {
143
+function install_marconiclient {
144 144
     git_clone $MARCONICLIENT_REPO $MARCONICLIENT_DIR $MARCONICLIENT_BRANCH
145 145
     setup_develop $MARCONICLIENT_DIR
146 146
 }
147 147
 
148 148
 # start_marconi() - Start running processes, including screen
149
-function start_marconi() {
149
+function start_marconi {
150 150
     screen_it marconi-server "marconi-server --config-file $MARCONI_CONF"
151 151
     echo "Waiting for Marconi to start..."
152 152
     if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- $MARCONI_SERVICE_PROTOCOL://$MARCONI_SERVICE_HOST:$MARCONI_SERVICE_PORT/v1/health; do sleep 1; done"; then
... ...
@@ -155,14 +155,14 @@ function start_marconi() {
155 155
 }
156 156
 
157 157
 # stop_marconi() - Stop running processes
158
-function stop_marconi() {
158
+function stop_marconi {
159 159
     # Kill the marconi screen windows
160 160
     for serv in marconi-server; do
161 161
         screen -S $SCREEN_NAME -p $serv -X kill
162 162
     done
163 163
 }
164 164
 
165
-function create_marconi_accounts() {
165
+function create_marconi_accounts {
166 166
     SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
167 167
     ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
168 168
 
... ...
@@ -253,7 +253,7 @@ function is_neutron_enabled {
253 253
 
254 254
 # configure_neutron()
255 255
 # Set common config for all neutron server and agents.
256
-function configure_neutron() {
256
+function configure_neutron {
257 257
     _configure_neutron_common
258 258
     iniset_rpc_backend neutron $NEUTRON_CONF DEFAULT
259 259
 
... ...
@@ -289,7 +289,7 @@ function configure_neutron() {
289 289
     _configure_neutron_debug_command
290 290
 }
291 291
 
292
-function create_nova_conf_neutron() {
292
+function create_nova_conf_neutron {
293 293
     iniset $NOVA_CONF DEFAULT network_api_class "nova.network.neutronv2.api.API"
294 294
     iniset $NOVA_CONF DEFAULT neutron_admin_username "$Q_ADMIN_USERNAME"
295 295
     iniset $NOVA_CONF DEFAULT neutron_admin_password "$SERVICE_PASSWORD"
... ...
@@ -316,7 +316,7 @@ function create_nova_conf_neutron() {
316 316
 }
317 317
 
318 318
 # create_neutron_cache_dir() - Part of the _neutron_setup_keystone() process
319
-function create_neutron_cache_dir() {
319
+function create_neutron_cache_dir {
320 320
     # Create cache dir
321 321
     sudo mkdir -p $NEUTRON_AUTH_CACHE_DIR
322 322
     sudo chown $STACK_USER $NEUTRON_AUTH_CACHE_DIR
... ...
@@ -330,7 +330,7 @@ function create_neutron_cache_dir() {
330 330
 # service              neutron    admin        # if enabled
331 331
 
332 332
 # Migrated from keystone_data.sh
333
-function create_neutron_accounts() {
333
+function create_neutron_accounts {
334 334
 
335 335
     SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
336 336
     ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
... ...
@@ -362,7 +362,7 @@ function create_neutron_accounts() {
362 362
     fi
363 363
 }
364 364
 
365
-function create_neutron_initial_network() {
365
+function create_neutron_initial_network {
366 366
     TENANT_ID=$(openstack project list | grep " demo " | get_field 1)
367 367
     die_if_not_set $LINENO TENANT_ID "Failure retrieving TENANT_ID for demo"
368 368
 
... ...
@@ -429,27 +429,27 @@ function create_neutron_initial_network() {
429 429
 }
430 430
 
431 431
 # init_neutron() - Initialize databases, etc.
432
-function init_neutron() {
432
+function init_neutron {
433 433
     recreate_database $Q_DB_NAME utf8
434 434
     # Run Neutron db migrations
435 435
     $NEUTRON_BIN_DIR/neutron-db-manage --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE upgrade head
436 436
 }
437 437
 
438 438
 # install_neutron() - Collect source and prepare
439
-function install_neutron() {
439
+function install_neutron {
440 440
     git_clone $NEUTRON_REPO $NEUTRON_DIR $NEUTRON_BRANCH
441 441
     setup_develop $NEUTRON_DIR
442 442
 }
443 443
 
444 444
 # install_neutronclient() - Collect source and prepare
445
-function install_neutronclient() {
445
+function install_neutronclient {
446 446
     git_clone $NEUTRONCLIENT_REPO $NEUTRONCLIENT_DIR $NEUTRONCLIENT_BRANCH
447 447
     setup_develop $NEUTRONCLIENT_DIR
448 448
     sudo install -D -m 0644 -o $STACK_USER {$NEUTRONCLIENT_DIR/tools/,/etc/bash_completion.d/}neutron.bash_completion
449 449
 }
450 450
 
451 451
 # install_neutron_agent_packages() - Collect source and prepare
452
-function install_neutron_agent_packages() {
452
+function install_neutron_agent_packages {
453 453
     # install packages that are specific to plugin agent(s)
454 454
     if is_service_enabled q-agt q-dhcp q-l3; then
455 455
         neutron_plugin_install_agent_packages
... ...
@@ -461,7 +461,7 @@ function install_neutron_agent_packages() {
461 461
 }
462 462
 
463 463
 # Start running processes, including screen
464
-function start_neutron_service_and_check() {
464
+function start_neutron_service_and_check {
465 465
     # build config-file options
466 466
     local cfg_file
467 467
     local CFG_FILE_OPTIONS="--config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE"
... ...
@@ -477,7 +477,7 @@ function start_neutron_service_and_check() {
477 477
 }
478 478
 
479 479
 # Start running processes, including screen
480
-function start_neutron_agents() {
480
+function start_neutron_agents {
481 481
     # Start up the neutron agents if enabled
482 482
     screen_it q-agt "cd $NEUTRON_DIR && python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE"
483 483
     screen_it q-dhcp "cd $NEUTRON_DIR && python $AGENT_DHCP_BINARY --config-file $NEUTRON_CONF --config-file=$Q_DHCP_CONF_FILE"
... ...
@@ -510,7 +510,7 @@ function start_neutron_agents() {
510 510
 }
511 511
 
512 512
 # stop_neutron() - Stop running processes (non-screen)
513
-function stop_neutron() {
513
+function stop_neutron {
514 514
     if is_service_enabled q-dhcp; then
515 515
         pid=$(ps aux | awk '/[d]nsmasq.+interface=(tap|ns-)/ { print $2 }')
516 516
         [ ! -z "$pid" ] && sudo kill -9 $pid
... ...
@@ -535,7 +535,7 @@ function stop_neutron() {
535 535
 
536 536
 # cleanup_neutron() - Remove residual data files, anything left over from previous
537 537
 # runs that a clean run would need to clean up
538
-function cleanup_neutron() {
538
+function cleanup_neutron {
539 539
     if is_neutron_ovs_base_plugin; then
540 540
         neutron_ovs_base_cleanup
541 541
     fi
... ...
@@ -549,7 +549,7 @@ function cleanup_neutron() {
549 549
 # _configure_neutron_common()
550 550
 # Set common config for all neutron server and agents.
551 551
 # This MUST be called before other ``_configure_neutron_*`` functions.
552
-function _configure_neutron_common() {
552
+function _configure_neutron_common {
553 553
     # Put config files in ``NEUTRON_CONF_DIR`` for everyone to find
554 554
     if [[ ! -d $NEUTRON_CONF_DIR ]]; then
555 555
         sudo mkdir -p $NEUTRON_CONF_DIR
... ...
@@ -611,7 +611,7 @@ function _configure_neutron_common() {
611 611
     _neutron_setup_rootwrap
612 612
 }
613 613
 
614
-function _configure_neutron_debug_command() {
614
+function _configure_neutron_debug_command {
615 615
     if [[ "$Q_USE_DEBUG_COMMAND" != "True" ]]; then
616 616
         return
617 617
     fi
... ...
@@ -628,7 +628,7 @@ function _configure_neutron_debug_command() {
628 628
     neutron_plugin_configure_debug_command
629 629
 }
630 630
 
631
-function _configure_neutron_dhcp_agent() {
631
+function _configure_neutron_dhcp_agent {
632 632
     AGENT_DHCP_BINARY="$NEUTRON_BIN_DIR/neutron-dhcp-agent"
633 633
     Q_DHCP_CONF_FILE=$NEUTRON_CONF_DIR/dhcp_agent.ini
634 634
 
... ...
@@ -652,7 +652,7 @@ function _configure_neutron_dhcp_agent() {
652 652
     neutron_plugin_configure_dhcp_agent
653 653
 }
654 654
 
655
-function _configure_neutron_l3_agent() {
655
+function _configure_neutron_l3_agent {
656 656
     Q_L3_ENABLED=True
657 657
     # for l3-agent, only use per tenant router if we have namespaces
658 658
     Q_L3_ROUTER_PER_TENANT=$Q_USE_NAMESPACE
... ...
@@ -676,7 +676,7 @@ function _configure_neutron_l3_agent() {
676 676
     neutron_plugin_configure_l3_agent
677 677
 }
678 678
 
679
-function _configure_neutron_metadata_agent() {
679
+function _configure_neutron_metadata_agent {
680 680
     AGENT_META_BINARY="$NEUTRON_BIN_DIR/neutron-metadata-agent"
681 681
     Q_META_CONF_FILE=$NEUTRON_CONF_DIR/metadata_agent.ini
682 682
 
... ...
@@ -691,30 +691,29 @@ function _configure_neutron_metadata_agent() {
691 691
 
692 692
 }
693 693
 
694
-function _configure_neutron_lbaas() {
694
+function _configure_neutron_lbaas {
695 695
     neutron_agent_lbaas_configure_common
696 696
     neutron_agent_lbaas_configure_agent
697 697
 }
698 698
 
699
-function _configure_neutron_metering() {
699
+function _configure_neutron_metering {
700 700
     neutron_agent_metering_configure_common
701 701
     neutron_agent_metering_configure_agent
702 702
 }
703 703
 
704
-function _configure_neutron_fwaas() {
704
+function _configure_neutron_fwaas {
705 705
     neutron_fwaas_configure_common
706 706
     neutron_fwaas_configure_driver
707 707
 }
708 708
 
709
-function _configure_neutron_vpn()
710
-{
709
+function _configure_neutron_vpn {
711 710
     neutron_vpn_install_agent_packages
712 711
     neutron_vpn_configure_common
713 712
 }
714 713
 
715 714
 # _configure_neutron_plugin_agent() - Set config files for neutron plugin agent
716 715
 # It is called when q-agt is enabled.
717
-function _configure_neutron_plugin_agent() {
716
+function _configure_neutron_plugin_agent {
718 717
     # Specify the default root helper prior to agent configuration to
719 718
     # ensure that an agent's configuration can override the default
720 719
     iniset /$Q_PLUGIN_CONF_FILE agent root_helper "$Q_RR_COMMAND"
... ...
@@ -727,7 +726,7 @@ function _configure_neutron_plugin_agent() {
727 727
 
728 728
 # _configure_neutron_service() - Set config files for neutron service
729 729
 # It is called when q-svc is enabled.
730
-function _configure_neutron_service() {
730
+function _configure_neutron_service {
731 731
     Q_API_PASTE_FILE=$NEUTRON_CONF_DIR/api-paste.ini
732 732
     Q_POLICY_FILE=$NEUTRON_CONF_DIR/policy.json
733 733
 
... ...
@@ -765,7 +764,7 @@ function _configure_neutron_service() {
765 765
 #------------------
766 766
 
767 767
 # _neutron_service_plugin_class_add() - add service plugin class
768
-function _neutron_service_plugin_class_add() {
768
+function _neutron_service_plugin_class_add {
769 769
     local service_plugin_class=$1
770 770
     if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then
771 771
         Q_SERVICE_PLUGIN_CLASSES=$service_plugin_class
... ...
@@ -775,7 +774,7 @@ function _neutron_service_plugin_class_add() {
775 775
 }
776 776
 
777 777
 # _neutron_setup_rootwrap() - configure Neutron's rootwrap
778
-function _neutron_setup_rootwrap() {
778
+function _neutron_setup_rootwrap {
779 779
     if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
780 780
         return
781 781
     fi
... ...
@@ -815,7 +814,7 @@ function _neutron_setup_rootwrap() {
815 815
 }
816 816
 
817 817
 # Configures keystone integration for neutron service and agents
818
-function _neutron_setup_keystone() {
818
+function _neutron_setup_keystone {
819 819
     local conf_file=$1
820 820
     local section=$2
821 821
     local use_auth_url=$3
... ...
@@ -842,7 +841,7 @@ function _neutron_setup_keystone() {
842 842
     fi
843 843
 }
844 844
 
845
-function _neutron_setup_interface_driver() {
845
+function _neutron_setup_interface_driver {
846 846
 
847 847
     # ovs_use_veth needs to be set before the plugin configuration
848 848
     # occurs to allow plugins to override the setting.
... ...
@@ -854,14 +853,14 @@ function _neutron_setup_interface_driver() {
854 854
 # Functions for Neutron Exercises
855 855
 #--------------------------------
856 856
 
857
-function delete_probe() {
857
+function delete_probe {
858 858
     local from_net="$1"
859 859
     net_id=`_get_net_id $from_net`
860 860
     probe_id=`neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}'`
861 861
     neutron-debug --os-tenant-name admin --os-username admin probe-delete $probe_id
862 862
 }
863 863
 
864
-function setup_neutron_debug() {
864
+function setup_neutron_debug {
865 865
     if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
866 866
         public_net_id=`_get_net_id $PUBLIC_NETWORK_NAME`
867 867
         neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $public_net_id
... ...
@@ -870,23 +869,23 @@ function setup_neutron_debug() {
870 870
     fi
871 871
 }
872 872
 
873
-function teardown_neutron_debug() {
873
+function teardown_neutron_debug {
874 874
     delete_probe $PUBLIC_NETWORK_NAME
875 875
     delete_probe $PRIVATE_NETWORK_NAME
876 876
 }
877 877
 
878
-function _get_net_id() {
878
+function _get_net_id {
879 879
     neutron --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD net-list | grep $1 | awk '{print $2}'
880 880
 }
881 881
 
882
-function _get_probe_cmd_prefix() {
882
+function _get_probe_cmd_prefix {
883 883
     local from_net="$1"
884 884
     net_id=`_get_net_id $from_net`
885 885
     probe_id=`neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}' | head -n 1`
886 886
     echo "$Q_RR_COMMAND ip netns exec qprobe-$probe_id"
887 887
 }
888 888
 
889
-function _ping_check_neutron() {
889
+function _ping_check_neutron {
890 890
     local from_net=$1
891 891
     local ip=$2
892 892
     local timeout_sec=$3
... ...
@@ -908,7 +907,7 @@ function _ping_check_neutron() {
908 908
 }
909 909
 
910 910
 # ssh check
911
-function _ssh_check_neutron() {
911
+function _ssh_check_neutron {
912 912
     local from_net=$1
913 913
     local key_file=$2
914 914
     local ip=$3
... ...
@@ -934,39 +933,39 @@ for f in $TOP_DIR/lib/neutron_thirdparty/*; do
934 934
     fi
935 935
 done
936 936
 
937
-function _neutron_third_party_do() {
937
+function _neutron_third_party_do {
938 938
     for third_party in ${NEUTRON_THIRD_PARTIES//,/ }; do
939 939
         ${1}_${third_party}
940 940
     done
941 941
 }
942 942
 
943 943
 # configure_neutron_third_party() - Set config files, create data dirs, etc
944
-function configure_neutron_third_party() {
944
+function configure_neutron_third_party {
945 945
     _neutron_third_party_do configure
946 946
 }
947 947
 
948 948
 # init_neutron_third_party() - Initialize databases, etc.
949
-function init_neutron_third_party() {
949
+function init_neutron_third_party {
950 950
     _neutron_third_party_do init
951 951
 }
952 952
 
953 953
 # install_neutron_third_party() - Collect source and prepare
954
-function install_neutron_third_party() {
954
+function install_neutron_third_party {
955 955
     _neutron_third_party_do install
956 956
 }
957 957
 
958 958
 # start_neutron_third_party() - Start running processes, including screen
959
-function start_neutron_third_party() {
959
+function start_neutron_third_party {
960 960
     _neutron_third_party_do start
961 961
 }
962 962
 
963 963
 # stop_neutron_third_party - Stop running processes (non-screen)
964
-function stop_neutron_third_party() {
964
+function stop_neutron_third_party {
965 965
     _neutron_third_party_do stop
966 966
 }
967 967
 
968 968
 # check_neutron_third_party_integration() - Check that third party integration is sane
969
-function check_neutron_third_party_integration() {
969
+function check_neutron_third_party_integration {
970 970
     _neutron_third_party_do check
971 971
 }
972 972
 
... ...
@@ -8,15 +8,15 @@ set +o xtrace
8 8
 source $TOP_DIR/lib/neutron_plugins/ovs_base
9 9
 source $TOP_DIR/lib/neutron_thirdparty/bigswitch_floodlight     # for third party service specific configuration values
10 10
 
11
-function neutron_plugin_create_nova_conf() {
11
+function neutron_plugin_create_nova_conf {
12 12
     :
13 13
 }
14 14
 
15
-function neutron_plugin_install_agent_packages() {
15
+function neutron_plugin_install_agent_packages {
16 16
     _neutron_ovs_base_install_agent_packages
17 17
 }
18 18
 
19
-function neutron_plugin_configure_common() {
19
+function neutron_plugin_configure_common {
20 20
     Q_PLUGIN_CONF_PATH=etc/neutron/plugins/bigswitch
21 21
     Q_PLUGIN_CONF_FILENAME=restproxy.ini
22 22
     Q_DB_NAME="restproxy_neutron"
... ...
@@ -25,23 +25,23 @@ function neutron_plugin_configure_common() {
25 25
     BS_FL_CONTROLLER_TIMEOUT=${BS_FL_CONTROLLER_TIMEOUT:-10}
26 26
 }
27 27
 
28
-function neutron_plugin_configure_debug_command() {
28
+function neutron_plugin_configure_debug_command {
29 29
     _neutron_ovs_base_configure_debug_command
30 30
 }
31 31
 
32
-function neutron_plugin_configure_dhcp_agent() {
32
+function neutron_plugin_configure_dhcp_agent {
33 33
     :
34 34
 }
35 35
 
36
-function neutron_plugin_configure_l3_agent() {
36
+function neutron_plugin_configure_l3_agent {
37 37
     _neutron_ovs_base_configure_l3_agent
38 38
 }
39 39
 
40
-function neutron_plugin_configure_plugin_agent() {
40
+function neutron_plugin_configure_plugin_agent {
41 41
     :
42 42
 }
43 43
 
44
-function neutron_plugin_configure_service() {
44
+function neutron_plugin_configure_service {
45 45
     iniset /$Q_PLUGIN_CONF_FILE restproxy servers $BS_FL_CONTROLLERS_PORT
46 46
     iniset /$Q_PLUGIN_CONF_FILE restproxy servertimeout $BS_FL_CONTROLLER_TIMEOUT
47 47
     if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then
... ...
@@ -49,7 +49,7 @@ function neutron_plugin_configure_service() {
49 49
     fi
50 50
 }
51 51
 
52
-function neutron_plugin_setup_interface_driver() {
52
+function neutron_plugin_setup_interface_driver {
53 53
     local conf_file=$1
54 54
     if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then
55 55
         iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.IVSInterfaceDriver
... ...
@@ -59,12 +59,12 @@ function neutron_plugin_setup_interface_driver() {
59 59
 }
60 60
 
61 61
 
62
-function has_neutron_plugin_security_group() {
62
+function has_neutron_plugin_security_group {
63 63
     # 1 means False here
64 64
     return 1
65 65
 }
66 66
 
67
-function neutron_plugin_check_adv_test_requirements() {
67
+function neutron_plugin_check_adv_test_requirements {
68 68
     is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
69 69
 }
70 70
 
... ...
@@ -5,53 +5,53 @@
5 5
 BRCD_XTRACE=$(set +o | grep xtrace)
6 6
 set +o xtrace
7 7
 
8
-function is_neutron_ovs_base_plugin() {
8
+function is_neutron_ovs_base_plugin {
9 9
     return 1
10 10
 }
11 11
 
12
-function neutron_plugin_create_nova_conf() {
12
+function neutron_plugin_create_nova_conf {
13 13
     NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
14 14
 }
15 15
 
16
-function neutron_plugin_install_agent_packages() {
16
+function neutron_plugin_install_agent_packages {
17 17
     install_package bridge-utils
18 18
 }
19 19
 
20
-function neutron_plugin_configure_common() {
20
+function neutron_plugin_configure_common {
21 21
     Q_PLUGIN_CONF_PATH=etc/neutron/plugins/brocade
22 22
     Q_PLUGIN_CONF_FILENAME=brocade.ini
23 23
     Q_DB_NAME="brcd_neutron"
24 24
     Q_PLUGIN_CLASS="neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2"
25 25
 }
26 26
 
27
-function neutron_plugin_configure_debug_command() {
27
+function neutron_plugin_configure_debug_command {
28 28
     iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge
29 29
 }
30 30
 
31
-function neutron_plugin_configure_dhcp_agent() {
31
+function neutron_plugin_configure_dhcp_agent {
32 32
     iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
33 33
 }
34 34
 
35
-function neutron_plugin_configure_l3_agent() {
35
+function neutron_plugin_configure_l3_agent {
36 36
     iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge
37 37
     iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
38 38
 }
39 39
 
40
-function neutron_plugin_configure_plugin_agent() {
40
+function neutron_plugin_configure_plugin_agent {
41 41
     AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-linuxbridge-agent"
42 42
 }
43 43
 
44
-function neutron_plugin_setup_interface_driver() {
44
+function neutron_plugin_setup_interface_driver {
45 45
     local conf_file=$1
46 46
     iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
47 47
 }
48 48
 
49
-function has_neutron_plugin_security_group() {
49
+function has_neutron_plugin_security_group {
50 50
     # 0 means True here
51 51
     return 0
52 52
 }
53 53
 
54
-function neutron_plugin_check_adv_test_requirements() {
54
+function neutron_plugin_check_adv_test_requirements {
55 55
     is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
56 56
 }
57 57
 
... ...
@@ -27,12 +27,12 @@ NCCLIENT_REPO=${NCCLIENT_REPO:-${GIT_BASE}/CiscoSystems/ncclient.git}
27 27
 NCCLIENT_BRANCH=${NCCLIENT_BRANCH:-master}
28 28
 
29 29
 # This routine put a prefix on an existing function name
30
-function _prefix_function() {
30
+function _prefix_function {
31 31
     declare -F $1 > /dev/null || die "$1 doesn't exist"
32 32
     eval "$(echo "${2}_${1}()"; declare -f ${1} | tail -n +2)"
33 33
 }
34 34
 
35
-function _has_ovs_subplugin() {
35
+function _has_ovs_subplugin {
36 36
     local subplugin
37 37
     for subplugin in ${Q_CISCO_PLUGIN_SUBPLUGINS[@]}; do
38 38
         if [[ "$subplugin" == "openvswitch" ]]; then
... ...
@@ -42,7 +42,7 @@ function _has_ovs_subplugin() {
42 42
     return 1
43 43
 }
44 44
 
45
-function _has_nexus_subplugin() {
45
+function _has_nexus_subplugin {
46 46
     local subplugin
47 47
     for subplugin in ${Q_CISCO_PLUGIN_SUBPLUGINS[@]}; do
48 48
         if [[ "$subplugin" == "nexus" ]]; then
... ...
@@ -52,7 +52,7 @@ function _has_nexus_subplugin() {
52 52
     return 1
53 53
 }
54 54
 
55
-function _has_n1kv_subplugin() {
55
+function _has_n1kv_subplugin {
56 56
     local subplugin
57 57
     for subplugin in ${Q_CISCO_PLUGIN_SUBPLUGINS[@]}; do
58 58
         if [[ "$subplugin" == "n1kv" ]]; then
... ...
@@ -64,7 +64,7 @@ function _has_n1kv_subplugin() {
64 64
 
65 65
 # This routine populates the cisco config file with the information for
66 66
 # a particular nexus switch
67
-function _config_switch() {
67
+function _config_switch {
68 68
     local cisco_cfg_file=$1
69 69
     local switch_ip=$2
70 70
     local username=$3
... ...
@@ -99,7 +99,7 @@ _prefix_function neutron_plugin_setup_interface_driver ovs
99 99
 _prefix_function has_neutron_plugin_security_group ovs
100 100
 
101 101
 # Check the version of the installed ncclient package
102
-function check_ncclient_version() {
102
+function check_ncclient_version {
103 103
 python << EOF
104 104
 version = '$NCCLIENT_VERSION'
105 105
 import sys
... ...
@@ -115,13 +115,13 @@ EOF
115 115
 }
116 116
 
117 117
 # Install the ncclient package
118
-function install_ncclient() {
118
+function install_ncclient {
119 119
     git_clone $NCCLIENT_REPO $NCCLIENT_DIR $NCCLIENT_BRANCH
120 120
     (cd $NCCLIENT_DIR; sudo python setup.py install)
121 121
 }
122 122
 
123 123
 # Check if the required version of ncclient has been installed
124
-function is_ncclient_installed() {
124
+function is_ncclient_installed {
125 125
     # Check if the Cisco ncclient repository exists
126 126
     if [[ -d $NCCLIENT_DIR ]]; then
127 127
         remotes=$(cd $NCCLIENT_DIR; git remote -v | grep fetch | awk '{ print $2}')
... ...
@@ -144,7 +144,7 @@ function is_ncclient_installed() {
144 144
     return 0
145 145
 }
146 146
 
147
-function has_neutron_plugin_security_group() {
147
+function has_neutron_plugin_security_group {
148 148
     if _has_ovs_subplugin; then
149 149
         ovs_has_neutron_plugin_security_group
150 150
     else
... ...
@@ -152,14 +152,14 @@ function has_neutron_plugin_security_group() {
152 152
     fi
153 153
 }
154 154
 
155
-function is_neutron_ovs_base_plugin() {
155
+function is_neutron_ovs_base_plugin {
156 156
     # Cisco uses OVS if openvswitch subplugin is deployed
157 157
     _has_ovs_subplugin
158 158
     return
159 159
 }
160 160
 
161 161
 # populate required nova configuration parameters
162
-function neutron_plugin_create_nova_conf() {
162
+function neutron_plugin_create_nova_conf {
163 163
     if _has_ovs_subplugin; then
164 164
         ovs_neutron_plugin_create_nova_conf
165 165
     else
... ...
@@ -167,13 +167,13 @@ function neutron_plugin_create_nova_conf() {
167 167
     fi
168 168
 }
169 169
 
170
-function neutron_plugin_install_agent_packages() {
170
+function neutron_plugin_install_agent_packages {
171 171
     # Cisco plugin uses openvswitch to operate in one of its configurations
172 172
     ovs_neutron_plugin_install_agent_packages
173 173
 }
174 174
 
175 175
 # Configure common parameters
176
-function neutron_plugin_configure_common() {
176
+function neutron_plugin_configure_common {
177 177
     # setup default subplugins
178 178
     if [ ! -v Q_CISCO_PLUGIN_SUBPLUGINS ]; then
179 179
         declare -ga Q_CISCO_PLUGIN_SUBPLUGINS
... ...
@@ -191,23 +191,23 @@ function neutron_plugin_configure_common() {
191 191
     Q_DB_NAME=cisco_neutron
192 192
 }
193 193
 
194
-function neutron_plugin_configure_debug_command() {
194
+function neutron_plugin_configure_debug_command {
195 195
     if _has_ovs_subplugin; then
196 196
         ovs_neutron_plugin_configure_debug_command
197 197
     fi
198 198
 }
199 199
 
200
-function neutron_plugin_configure_dhcp_agent() {
200
+function neutron_plugin_configure_dhcp_agent {
201 201
     iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
202 202
 }
203 203
 
204
-function neutron_plugin_configure_l3_agent() {
204
+function neutron_plugin_configure_l3_agent {
205 205
     if _has_ovs_subplugin; then
206 206
         ovs_neutron_plugin_configure_l3_agent
207 207
     fi
208 208
 }
209 209
 
210
-function _configure_nexus_subplugin() {
210
+function _configure_nexus_subplugin {
211 211
     local cisco_cfg_file=$1
212 212
 
213 213
     # Install a known compatible ncclient from the Cisco repository if necessary
... ...
@@ -252,7 +252,7 @@ function _configure_nexus_subplugin() {
252 252
 }
253 253
 
254 254
 # Configure n1kv plugin
255
-function _configure_n1kv_subplugin() {
255
+function _configure_n1kv_subplugin {
256 256
     local cisco_cfg_file=$1
257 257
 
258 258
     # populate the cisco plugin cfg file with the VSM information
... ...
@@ -270,13 +270,13 @@ function _configure_n1kv_subplugin() {
270 270
     _neutron_ovs_base_setup_bridge $OVS_BRIDGE
271 271
 }
272 272
 
273
-function neutron_plugin_configure_plugin_agent() {
273
+function neutron_plugin_configure_plugin_agent {
274 274
     if _has_ovs_subplugin; then
275 275
         ovs_neutron_plugin_configure_plugin_agent
276 276
     fi
277 277
 }
278 278
 
279
-function neutron_plugin_configure_service() {
279
+function neutron_plugin_configure_service {
280 280
     local subplugin
281 281
     local cisco_cfg_file
282 282
 
... ...
@@ -318,7 +318,7 @@ function neutron_plugin_configure_service() {
318 318
     fi
319 319
 }
320 320
 
321
-function neutron_plugin_setup_interface_driver() {
321
+function neutron_plugin_setup_interface_driver {
322 322
     local conf_file=$1
323 323
     iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
324 324
 }
... ...
@@ -7,7 +7,7 @@ set +o xtrace
7 7
 
8 8
 source $TOP_DIR/lib/neutron_plugins/openvswitch
9 9
 
10
-save_function() {
10
+function save_function {
11 11
     local ORIG_FUNC=$(declare -f $1)
12 12
     local NEW_FUNC="$2${ORIG_FUNC#$1}"
13 13
     eval "$NEW_FUNC"
... ...
@@ -15,14 +15,14 @@ save_function() {
15 15
 
16 16
 save_function neutron_plugin_configure_service _neutron_plugin_configure_service
17 17
 
18
-function neutron_plugin_configure_common() {
18
+function neutron_plugin_configure_common {
19 19
     Q_PLUGIN_CONF_PATH=etc/neutron/plugins/embrane
20 20
     Q_PLUGIN_CONF_FILENAME=heleos_conf.ini
21 21
     Q_DB_NAME="ovs_neutron"
22 22
     Q_PLUGIN_CLASS="neutron.plugins.embrane.plugins.embrane_ovs_plugin.EmbraneOvsPlugin"
23 23
 }
24 24
 
25
-function neutron_plugin_configure_service() {
25
+function neutron_plugin_configure_service {
26 26
     _neutron_plugin_configure_service
27 27
     iniset /$Q_PLUGIN_CONF_FILE heleos esm_mgmt $HELEOS_ESM_MGMT
28 28
     iniset /$Q_PLUGIN_CONF_FILE heleos admin_username $HELEOS_ADMIN_USERNAME
... ...
@@ -7,14 +7,14 @@ set +o xtrace
7 7
 
8 8
 source $TOP_DIR/lib/neutron_plugins/linuxbridge_agent
9 9
 
10
-function neutron_plugin_configure_common() {
10
+function neutron_plugin_configure_common {
11 11
     Q_PLUGIN_CONF_PATH=etc/neutron/plugins/linuxbridge
12 12
     Q_PLUGIN_CONF_FILENAME=linuxbridge_conf.ini
13 13
     Q_DB_NAME="neutron_linux_bridge"
14 14
     Q_PLUGIN_CLASS="neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2"
15 15
 }
16 16
 
17
-function neutron_plugin_configure_service() {
17
+function neutron_plugin_configure_service {
18 18
     if [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
19 19
         iniset /$Q_PLUGIN_CONF_FILE vlans tenant_network_type vlan
20 20
     else
... ...
@@ -47,7 +47,7 @@ function neutron_plugin_configure_service() {
47 47
     done
48 48
 }
49 49
 
50
-function has_neutron_plugin_security_group() {
50
+function has_neutron_plugin_security_group {
51 51
     # 0 means True here
52 52
     return 0
53 53
 }
... ...
@@ -5,33 +5,33 @@
5 5
 PLUGIN_XTRACE=$(set +o | grep xtrace)
6 6
 set +o xtrace
7 7
 
8
-function is_neutron_ovs_base_plugin() {
8
+function is_neutron_ovs_base_plugin {
9 9
     # linuxbridge doesn't use OVS
10 10
     return 1
11 11
 }
12 12
 
13
-function neutron_plugin_create_nova_conf() {
13
+function neutron_plugin_create_nova_conf {
14 14
     :
15 15
 }
16 16
 
17
-function neutron_plugin_install_agent_packages() {
17
+function neutron_plugin_install_agent_packages {
18 18
     install_package bridge-utils
19 19
 }
20 20
 
21
-function neutron_plugin_configure_debug_command() {
21
+function neutron_plugin_configure_debug_command {
22 22
     iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge
23 23
 }
24 24
 
25
-function neutron_plugin_configure_dhcp_agent() {
25
+function neutron_plugin_configure_dhcp_agent {
26 26
     iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
27 27
 }
28 28
 
29
-function neutron_plugin_configure_l3_agent() {
29
+function neutron_plugin_configure_l3_agent {
30 30
     iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge
31 31
     iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
32 32
 }
33 33
 
34
-function neutron_plugin_configure_plugin_agent() {
34
+function neutron_plugin_configure_plugin_agent {
35 35
     # Setup physical network interface mappings.  Override
36 36
     # ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc`` for more
37 37
     # complex physical network configurations.
... ...
@@ -63,12 +63,12 @@ function neutron_plugin_configure_plugin_agent() {
63 63
     done
64 64
 }
65 65
 
66
-function neutron_plugin_setup_interface_driver() {
66
+function neutron_plugin_setup_interface_driver {
67 67
     local conf_file=$1
68 68
     iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
69 69
 }
70 70
 
71
-function neutron_plugin_check_adv_test_requirements() {
71
+function neutron_plugin_check_adv_test_requirements {
72 72
     is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
73 73
 }
74 74
 
... ...
@@ -9,32 +9,32 @@ MIDONET_API_URL=${MIDONET_API_URL:-http://localhost:$MIDONET_API_PORT/midonet-ap
9 9
 MY_XTRACE=$(set +o | grep xtrace)
10 10
 set +o xtrace
11 11
 
12
-function is_neutron_ovs_base_plugin() {
12
+function is_neutron_ovs_base_plugin {
13 13
     # MidoNet does not use l3-agent
14 14
     # 0 means True here
15 15
     return 1
16 16
 }
17 17
 
18
-function neutron_plugin_create_nova_conf() {
18
+function neutron_plugin_create_nova_conf {
19 19
     NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
20 20
 }
21 21
 
22
-function neutron_plugin_install_agent_packages() {
22
+function neutron_plugin_install_agent_packages {
23 23
     :
24 24
 }
25 25
 
26
-function neutron_plugin_configure_common() {
26
+function neutron_plugin_configure_common {
27 27
     Q_PLUGIN_CONF_PATH=etc/neutron/plugins/midonet
28 28
     Q_PLUGIN_CONF_FILENAME=midonet.ini
29 29
     Q_DB_NAME="neutron_midonet"
30 30
     Q_PLUGIN_CLASS="neutron.plugins.midonet.plugin.MidonetPluginV2"
31 31
 }
32 32
 
33
-function neutron_plugin_configure_debug_command() {
33
+function neutron_plugin_configure_debug_command {
34 34
     :
35 35
 }
36 36
 
37
-function neutron_plugin_configure_dhcp_agent() {
37
+function neutron_plugin_configure_dhcp_agent {
38 38
     DHCP_DRIVER=${DHCP_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver"}
39 39
     neutron_plugin_setup_interface_driver $Q_DHCP_CONF_FILE
40 40
     iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_driver $DHCP_DRIVER
... ...
@@ -42,15 +42,15 @@ function neutron_plugin_configure_dhcp_agent() {
42 42
     iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
43 43
 }
44 44
 
45
-function neutron_plugin_configure_l3_agent() {
45
+function neutron_plugin_configure_l3_agent {
46 46
     die $LINENO "q-l3 must not be executed with MidoNet plugin!"
47 47
 }
48 48
 
49
-function neutron_plugin_configure_plugin_agent() {
49
+function neutron_plugin_configure_plugin_agent {
50 50
     die $LINENO "q-agt must not be executed with MidoNet plugin!"
51 51
 }
52 52
 
53
-function neutron_plugin_configure_service() {
53
+function neutron_plugin_configure_service {
54 54
     if [[ "$MIDONET_API_URL" != "" ]]; then
55 55
         iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URL
56 56
     fi
... ...
@@ -68,17 +68,17 @@ function neutron_plugin_configure_service() {
68 68
     Q_L3_ROUTER_PER_TENANT=True
69 69
 }
70 70
 
71
-function neutron_plugin_setup_interface_driver() {
71
+function neutron_plugin_setup_interface_driver {
72 72
     local conf_file=$1
73 73
     iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.MidonetInterfaceDriver
74 74
 }
75 75
 
76
-function has_neutron_plugin_security_group() {
76
+function has_neutron_plugin_security_group {
77 77
     # 0 means True here
78 78
     return 0
79 79
 }
80 80
 
81
-function neutron_plugin_check_adv_test_requirements() {
81
+function neutron_plugin_check_adv_test_requirements {
82 82
     # 0 means True here
83 83
     return 1
84 84
 }
... ...
@@ -33,7 +33,7 @@ Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS=${Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS:-}
33 33
 # L3 Plugin to load for ML2
34 34
 ML2_L3_PLUGIN=${ML2_L3_PLUGIN:-neutron.services.l3_router.l3_router_plugin.L3RouterPlugin}
35 35
 
36
-function populate_ml2_config() {
36
+function populate_ml2_config {
37 37
     CONF=$1
38 38
     SECTION=$2
39 39
     OPTS=$3
... ...
@@ -47,7 +47,7 @@ function populate_ml2_config() {
47 47
     done
48 48
 }
49 49
 
50
-function neutron_plugin_configure_common() {
50
+function neutron_plugin_configure_common {
51 51
     Q_PLUGIN_CONF_PATH=etc/neutron/plugins/ml2
52 52
     Q_PLUGIN_CONF_FILENAME=ml2_conf.ini
53 53
     Q_DB_NAME="neutron_ml2"
... ...
@@ -57,7 +57,7 @@ function neutron_plugin_configure_common() {
57 57
     _neutron_service_plugin_class_add $ML2_L3_PLUGIN
58 58
 }
59 59
 
60
-function neutron_plugin_configure_service() {
60
+function neutron_plugin_configure_service {
61 61
     if [[ "$Q_ML2_TENANT_NETWORK_TYPE" != "" ]]; then
62 62
         Q_SRV_EXTRA_OPTS+=(tenant_network_types=$Q_ML2_TENANT_NETWORK_TYPE)
63 63
     elif [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
... ...
@@ -114,7 +114,7 @@ function neutron_plugin_configure_service() {
114 114
     populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_type_vlan $Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS
115 115
 }
116 116
 
117
-function has_neutron_plugin_security_group() {
117
+function has_neutron_plugin_security_group {
118 118
     return 0
119 119
 }
120 120
 
... ...
@@ -22,11 +22,11 @@ OFC_RETRY_INTERVAL=${OFC_RETRY_INTERVAL:-1}
22 22
 
23 23
 source $TOP_DIR/lib/neutron_plugins/ovs_base
24 24
 
25
-function neutron_plugin_create_nova_conf() {
25
+function neutron_plugin_create_nova_conf {
26 26
     _neutron_ovs_base_configure_nova_vif_driver
27 27
 }
28 28
 
29
-function neutron_plugin_install_agent_packages() {
29
+function neutron_plugin_install_agent_packages {
30 30
     # SKIP_OVS_INSTALL is useful when we want to use Open vSwitch whose
31 31
     # version is different from the version provided by the distribution.
32 32
     if [[ "$SKIP_OVS_INSTALL" = "True" ]]; then
... ...
@@ -36,26 +36,26 @@ function neutron_plugin_install_agent_packages() {
36 36
     _neutron_ovs_base_install_agent_packages
37 37
 }
38 38
 
39
-function neutron_plugin_configure_common() {
39
+function neutron_plugin_configure_common {
40 40
     Q_PLUGIN_CONF_PATH=etc/neutron/plugins/nec
41 41
     Q_PLUGIN_CONF_FILENAME=nec.ini
42 42
     Q_DB_NAME="neutron_nec"
43 43
     Q_PLUGIN_CLASS="neutron.plugins.nec.nec_plugin.NECPluginV2"
44 44
 }
45 45
 
46
-function neutron_plugin_configure_debug_command() {
46
+function neutron_plugin_configure_debug_command {
47 47
     _neutron_ovs_base_configure_debug_command
48 48
 }
49 49
 
50
-function neutron_plugin_configure_dhcp_agent() {
50
+function neutron_plugin_configure_dhcp_agent {
51 51
     :
52 52
 }
53 53
 
54
-function neutron_plugin_configure_l3_agent() {
54
+function neutron_plugin_configure_l3_agent {
55 55
     _neutron_ovs_base_configure_l3_agent
56 56
 }
57 57
 
58
-function _quantum_plugin_setup_bridge() {
58
+function _quantum_plugin_setup_bridge {
59 59
     if [[ "$SKIP_OVS_BRIDGE_SETUP" = "True" ]]; then
60 60
         return
61 61
     fi
... ...
@@ -72,7 +72,7 @@ function _quantum_plugin_setup_bridge() {
72 72
     _neutron_setup_ovs_tunnels $OVS_BRIDGE
73 73
 }
74 74
 
75
-function neutron_plugin_configure_plugin_agent() {
75
+function neutron_plugin_configure_plugin_agent {
76 76
     _quantum_plugin_setup_bridge
77 77
 
78 78
     AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-nec-agent"
... ...
@@ -80,7 +80,7 @@ function neutron_plugin_configure_plugin_agent() {
80 80
     _neutron_ovs_base_configure_firewall_driver
81 81
 }
82 82
 
83
-function neutron_plugin_configure_service() {
83
+function neutron_plugin_configure_service {
84 84
     iniset $NEUTRON_CONF DEFAULT api_extensions_path neutron/plugins/nec/extensions/
85 85
     iniset /$Q_PLUGIN_CONF_FILE ofc host $OFC_API_HOST
86 86
     iniset /$Q_PLUGIN_CONF_FILE ofc port $OFC_API_PORT
... ...
@@ -91,7 +91,7 @@ function neutron_plugin_configure_service() {
91 91
     _neutron_ovs_base_configure_firewall_driver
92 92
 }
93 93
 
94
-function neutron_plugin_setup_interface_driver() {
94
+function neutron_plugin_setup_interface_driver {
95 95
     local conf_file=$1
96 96
     iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
97 97
     iniset $conf_file DEFAULT ovs_use_veth True
... ...
@@ -101,7 +101,7 @@ function neutron_plugin_setup_interface_driver() {
101 101
 # ---------------------------
102 102
 
103 103
 # Setup OVS tunnel manually
104
-function _neutron_setup_ovs_tunnels() {
104
+function _neutron_setup_ovs_tunnels {
105 105
     local bridge=$1
106 106
     local id=0
107 107
     GRE_LOCAL_IP=${GRE_LOCAL_IP:-$HOST_IP}
... ...
@@ -117,12 +117,12 @@ function _neutron_setup_ovs_tunnels() {
117 117
     fi
118 118
 }
119 119
 
120
-function has_neutron_plugin_security_group() {
120
+function has_neutron_plugin_security_group {
121 121
     # 0 means True here
122 122
     return 0
123 123
 }
124 124
 
125
-function neutron_plugin_check_adv_test_requirements() {
125
+function neutron_plugin_check_adv_test_requirements {
126 126
     is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
127 127
 }
128 128
 
... ...
@@ -7,14 +7,14 @@ set +o xtrace
7 7
 
8 8
 source $TOP_DIR/lib/neutron_plugins/openvswitch_agent
9 9
 
10
-function neutron_plugin_configure_common() {
10
+function neutron_plugin_configure_common {
11 11
     Q_PLUGIN_CONF_PATH=etc/neutron/plugins/openvswitch
12 12
     Q_PLUGIN_CONF_FILENAME=ovs_neutron_plugin.ini
13 13
     Q_DB_NAME="ovs_neutron"
14 14
     Q_PLUGIN_CLASS="neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2"
15 15
 }
16 16
 
17
-function neutron_plugin_configure_service() {
17
+function neutron_plugin_configure_service {
18 18
     if [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
19 19
         iniset /$Q_PLUGIN_CONF_FILE ovs tenant_network_type gre
20 20
         iniset /$Q_PLUGIN_CONF_FILE ovs tunnel_id_ranges $TENANT_TUNNEL_RANGES
... ...
@@ -52,7 +52,7 @@ function neutron_plugin_configure_service() {
52 52
     done
53 53
 }
54 54
 
55
-function has_neutron_plugin_security_group() {
55
+function has_neutron_plugin_security_group {
56 56
     return 0
57 57
 }
58 58
 
... ...
@@ -7,7 +7,7 @@ set +o xtrace
7 7
 
8 8
 source $TOP_DIR/lib/neutron_plugins/ovs_base
9 9
 
10
-function neutron_plugin_create_nova_conf() {
10
+function neutron_plugin_create_nova_conf {
11 11
     _neutron_ovs_base_configure_nova_vif_driver
12 12
     if [ "$VIRT_DRIVER" = 'xenserver' ]; then
13 13
         iniset $NOVA_CONF DEFAULT xenapi_vif_driver nova.virt.xenapi.vif.XenAPIOpenVswitchDriver
... ...
@@ -17,24 +17,24 @@ function neutron_plugin_create_nova_conf() {
17 17
     fi
18 18
 }
19 19
 
20
-function neutron_plugin_install_agent_packages() {
20
+function neutron_plugin_install_agent_packages {
21 21
     _neutron_ovs_base_install_agent_packages
22 22
 }
23 23
 
24
-function neutron_plugin_configure_debug_command() {
24
+function neutron_plugin_configure_debug_command {
25 25
     _neutron_ovs_base_configure_debug_command
26 26
 }
27 27
 
28
-function neutron_plugin_configure_dhcp_agent() {
28
+function neutron_plugin_configure_dhcp_agent {
29 29
     iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
30 30
 }
31 31
 
32
-function neutron_plugin_configure_l3_agent() {
32
+function neutron_plugin_configure_l3_agent {
33 33
     _neutron_ovs_base_configure_l3_agent
34 34
     iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
35 35
 }
36 36
 
37
-function neutron_plugin_configure_plugin_agent() {
37
+function neutron_plugin_configure_plugin_agent {
38 38
     # Setup integration bridge
39 39
     _neutron_ovs_base_setup_bridge $OVS_BRIDGE
40 40
     _neutron_ovs_base_configure_firewall_driver
... ...
@@ -118,12 +118,12 @@ function neutron_plugin_configure_plugin_agent() {
118 118
     done
119 119
 }
120 120
 
121
-function neutron_plugin_setup_interface_driver() {
121
+function neutron_plugin_setup_interface_driver {
122 122
     local conf_file=$1
123 123
     iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
124 124
 }
125 125
 
126
-function neutron_plugin_check_adv_test_requirements() {
126
+function neutron_plugin_check_adv_test_requirements {
127 127
     is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
128 128
 }
129 129
 
... ...
@@ -8,19 +8,19 @@ set +o xtrace
8 8
 OVS_BRIDGE=${OVS_BRIDGE:-br-int}
9 9
 PUBLIC_BRIDGE=${PUBLIC_BRIDGE:-br-ex}
10 10
 
11
-function is_neutron_ovs_base_plugin() {
11
+function is_neutron_ovs_base_plugin {
12 12
     # Yes, we use OVS.
13 13
     return 0
14 14
 }
15 15
 
16
-function _neutron_ovs_base_setup_bridge() {
16
+function _neutron_ovs_base_setup_bridge {
17 17
     local bridge=$1
18 18
     neutron-ovs-cleanup
19 19
     sudo ovs-vsctl --no-wait -- --may-exist add-br $bridge
20 20
     sudo ovs-vsctl --no-wait br-set-external-id $bridge bridge-id $bridge
21 21
 }
22 22
 
23
-function neutron_ovs_base_cleanup() {
23
+function neutron_ovs_base_cleanup {
24 24
     # remove all OVS ports that look like Neutron created ports
25 25
     for port in $(sudo ovs-vsctl list port | grep -o -e tap[0-9a-f\-]* -e q[rg]-[0-9a-f\-]*); do
26 26
         sudo ovs-vsctl del-port ${port}
... ...
@@ -32,7 +32,7 @@ function neutron_ovs_base_cleanup() {
32 32
     done
33 33
 }
34 34
 
35
-function _neutron_ovs_base_install_agent_packages() {
35
+function _neutron_ovs_base_install_agent_packages {
36 36
     local kernel_version
37 37
     # Install deps
38 38
     # FIXME add to ``files/apts/neutron``, but don't install if not needed!
... ...
@@ -50,11 +50,11 @@ function _neutron_ovs_base_install_agent_packages() {
50 50
     fi
51 51
 }
52 52
 
53
-function _neutron_ovs_base_configure_debug_command() {
53
+function _neutron_ovs_base_configure_debug_command {
54 54
     iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
55 55
 }
56 56
 
57
-function _neutron_ovs_base_configure_firewall_driver() {
57
+function _neutron_ovs_base_configure_firewall_driver {
58 58
     if [[ "$Q_USE_SECGROUP" == "True" ]]; then
59 59
         iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
60 60
     else
... ...
@@ -62,7 +62,7 @@ function _neutron_ovs_base_configure_firewall_driver() {
62 62
     fi
63 63
 }
64 64
 
65
-function _neutron_ovs_base_configure_l3_agent() {
65
+function _neutron_ovs_base_configure_l3_agent {
66 66
     iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
67 67
 
68 68
     neutron-ovs-cleanup
... ...
@@ -72,7 +72,7 @@ function _neutron_ovs_base_configure_l3_agent() {
72 72
     sudo ip addr flush dev $PUBLIC_BRIDGE
73 73
 }
74 74
 
75
-function _neutron_ovs_base_configure_nova_vif_driver() {
75
+function _neutron_ovs_base_configure_nova_vif_driver {
76 76
     :
77 77
 }
78 78
 
... ...
@@ -6,15 +6,15 @@
6 6
 MY_XTRACE=$(set +o | grep xtrace)
7 7
 set +o xtrace
8 8
 
9
-function neutron_plugin_create_nova_conf() {
9
+function neutron_plugin_create_nova_conf {
10 10
     :
11 11
 }
12 12
 
13
-function neutron_plugin_setup_interface_driver() {
13
+function neutron_plugin_setup_interface_driver {
14 14
     :
15 15
 }
16 16
 
17
-function neutron_plugin_configure_common() {
17
+function neutron_plugin_configure_common {
18 18
     Q_PLUGIN_CONF_PATH=etc/neutron/plugins/plumgrid
19 19
     Q_PLUGIN_CONF_FILENAME=plumgrid.ini
20 20
     Q_DB_NAME="plumgrid_neutron"
... ...
@@ -26,7 +26,7 @@ function neutron_plugin_configure_common() {
26 26
     PLUMGRID_TIMEOUT=${PLUMGRID_TIMEOUT:-70}
27 27
 }
28 28
 
29
-function neutron_plugin_configure_service() {
29
+function neutron_plugin_configure_service {
30 30
     iniset /$Q_PLUGIN_CONF_FILE PLUMgridDirector director_server $PLUMGRID_DIRECTOR_IP
31 31
     iniset /$Q_PLUGIN_CONF_FILE PLUMgridDirector director_server_port $PLUMGRID_DIRECTOR_PORT
32 32
     iniset /$Q_PLUGIN_CONF_FILE PLUMgridDirector username $PLUMGRID_ADMIN
... ...
@@ -34,21 +34,21 @@ function neutron_plugin_configure_service() {
34 34
     iniset /$Q_PLUGIN_CONF_FILE PLUMgridDirector servertimeout $PLUMGRID_TIMEOUT
35 35
 }
36 36
 
37
-function neutron_plugin_configure_debug_command() {
37
+function neutron_plugin_configure_debug_command {
38 38
     :
39 39
 }
40 40
 
41
-function is_neutron_ovs_base_plugin() {
41
+function is_neutron_ovs_base_plugin {
42 42
     # False
43 43
     return 1
44 44
 }
45 45
 
46
-function has_neutron_plugin_security_group() {
46
+function has_neutron_plugin_security_group {
47 47
     # False
48 48
     return 1
49 49
 }
50 50
 
51
-function neutron_plugin_check_adv_test_requirements() {
51
+function neutron_plugin_check_adv_test_requirements {
52 52
     is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
53 53
 }
54 54
 # Restore xtrace
... ...
@@ -8,12 +8,12 @@ set +o xtrace
8 8
 source $TOP_DIR/lib/neutron_plugins/ovs_base
9 9
 source $TOP_DIR/lib/neutron_thirdparty/ryu      # for configuration value
10 10
 
11
-function neutron_plugin_create_nova_conf() {
11
+function neutron_plugin_create_nova_conf {
12 12
     _neutron_ovs_base_configure_nova_vif_driver
13 13
     iniset $NOVA_CONF DEFAULT libvirt_ovs_integration_bridge "$OVS_BRIDGE"
14 14
 }
15 15
 
16
-function neutron_plugin_install_agent_packages() {
16
+function neutron_plugin_install_agent_packages {
17 17
     _neutron_ovs_base_install_agent_packages
18 18
 
19 19
     # neutron_ryu_agent requires ryu module
... ...
@@ -22,28 +22,28 @@ function neutron_plugin_install_agent_packages() {
22 22
     configure_ryu
23 23
 }
24 24
 
25
-function neutron_plugin_configure_common() {
25
+function neutron_plugin_configure_common {
26 26
     Q_PLUGIN_CONF_PATH=etc/neutron/plugins/ryu
27 27
     Q_PLUGIN_CONF_FILENAME=ryu.ini
28 28
     Q_DB_NAME="ovs_neutron"
29 29
     Q_PLUGIN_CLASS="neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2"
30 30
 }
31 31
 
32
-function neutron_plugin_configure_debug_command() {
32
+function neutron_plugin_configure_debug_command {
33 33
     _neutron_ovs_base_configure_debug_command
34 34
     iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
35 35
 }
36 36
 
37
-function neutron_plugin_configure_dhcp_agent() {
37
+function neutron_plugin_configure_dhcp_agent {
38 38
     iniset $Q_DHCP_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
39 39
 }
40 40
 
41
-function neutron_plugin_configure_l3_agent() {
41
+function neutron_plugin_configure_l3_agent {
42 42
     iniset $Q_L3_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
43 43
     _neutron_ovs_base_configure_l3_agent
44 44
 }
45 45
 
46
-function neutron_plugin_configure_plugin_agent() {
46
+function neutron_plugin_configure_plugin_agent {
47 47
     # Set up integration bridge
48 48
     _neutron_ovs_base_setup_bridge $OVS_BRIDGE
49 49
     if [ -n "$RYU_INTERNAL_INTERFACE" ]; then
... ...
@@ -55,24 +55,24 @@ function neutron_plugin_configure_plugin_agent() {
55 55
     _neutron_ovs_base_configure_firewall_driver
56 56
 }
57 57
 
58
-function neutron_plugin_configure_service() {
58
+function neutron_plugin_configure_service {
59 59
     iniset /$Q_PLUGIN_CONF_FILE ovs openflow_rest_api $RYU_API_HOST:$RYU_API_PORT
60 60
 
61 61
     _neutron_ovs_base_configure_firewall_driver
62 62
 }
63 63
 
64
-function neutron_plugin_setup_interface_driver() {
64
+function neutron_plugin_setup_interface_driver {
65 65
     local conf_file=$1
66 66
     iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
67 67
     iniset $conf_file DEFAULT ovs_use_veth True
68 68
 }
69 69
 
70
-function has_neutron_plugin_security_group() {
70
+function has_neutron_plugin_security_group {
71 71
     # 0 means True here
72 72
     return 0
73 73
 }
74 74
 
75
-function neutron_plugin_check_adv_test_requirements() {
75
+function neutron_plugin_check_adv_test_requirements {
76 76
     is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
77 77
 }
78 78
 
... ...
@@ -7,11 +7,11 @@ set +o xtrace
7 7
 
8 8
 FWAAS_PLUGIN=neutron.services.firewall.fwaas_plugin.FirewallPlugin
9 9
 
10
-function neutron_fwaas_configure_common() {
10
+function neutron_fwaas_configure_common {
11 11
     _neutron_service_plugin_class_add $FWAAS_PLUGIN
12 12
 }
13 13
 
14
-function neutron_fwaas_configure_driver() {
14
+function neutron_fwaas_configure_driver {
15 15
     FWAAS_DRIVER_CONF_FILENAME=/etc/neutron/fwaas_driver.ini
16 16
     cp $NEUTRON_DIR/etc/fwaas_driver.ini $FWAAS_DRIVER_CONF_FILENAME
17 17
 
... ...
@@ -19,7 +19,7 @@ function neutron_fwaas_configure_driver() {
19 19
     iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas driver "neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver"
20 20
 }
21 21
 
22
-function neutron_fwaas_stop() {
22
+function neutron_fwaas_stop {
23 23
     :
24 24
 }
25 25
 
... ...
@@ -9,7 +9,7 @@ set +o xtrace
9 9
 AGENT_LBAAS_BINARY="$NEUTRON_BIN_DIR/neutron-lbaas-agent"
10 10
 LBAAS_PLUGIN=neutron.services.loadbalancer.plugin.LoadBalancerPlugin
11 11
 
12
-function neutron_agent_lbaas_install_agent_packages() {
12
+function neutron_agent_lbaas_install_agent_packages {
13 13
     if is_ubuntu || is_fedora; then
14 14
         install_package haproxy
15 15
     elif is_suse; then
... ...
@@ -18,11 +18,11 @@ function neutron_agent_lbaas_install_agent_packages() {
18 18
     fi
19 19
 }
20 20
 
21
-function neutron_agent_lbaas_configure_common() {
21
+function neutron_agent_lbaas_configure_common {
22 22
     _neutron_service_plugin_class_add $LBAAS_PLUGIN
23 23
 }
24 24
 
25
-function neutron_agent_lbaas_configure_agent() {
25
+function neutron_agent_lbaas_configure_agent {
26 26
     LBAAS_AGENT_CONF_PATH=/etc/neutron/services/loadbalancer/haproxy
27 27
     mkdir -p $LBAAS_AGENT_CONF_PATH
28 28
 
... ...
@@ -41,7 +41,7 @@ function neutron_agent_lbaas_configure_agent() {
41 41
     fi
42 42
 }
43 43
 
44
-function neutron_lbaas_stop() {
44
+function neutron_lbaas_stop {
45 45
     pids=$(ps aux | awk '/haproxy/ { print $2 }')
46 46
     [ ! -z "$pids" ] && sudo kill $pids
47 47
 }
... ...
@@ -9,11 +9,11 @@ set +o xtrace
9 9
 AGENT_METERING_BINARY="$NEUTRON_BIN_DIR/neutron-metering-agent"
10 10
 METERING_PLUGIN="neutron.services.metering.metering_plugin.MeteringPlugin"
11 11
 
12
-function neutron_agent_metering_configure_common() {
12
+function neutron_agent_metering_configure_common {
13 13
     _neutron_service_plugin_class_add $METERING_PLUGIN
14 14
 }
15 15
 
16
-function neutron_agent_metering_configure_agent() {
16
+function neutron_agent_metering_configure_agent {
17 17
     METERING_AGENT_CONF_PATH=/etc/neutron/services/metering
18 18
     mkdir -p $METERING_AGENT_CONF_PATH
19 19
 
... ...
@@ -22,7 +22,7 @@ function neutron_agent_metering_configure_agent() {
22 22
     cp $NEUTRON_DIR/etc/metering_agent.ini $METERING_AGENT_CONF_FILENAME
23 23
 }
24 24
 
25
-function neutron_metering_stop() {
25
+function neutron_metering_stop {
26 26
     :
27 27
 }
28 28
 
... ...
@@ -10,15 +10,15 @@ AGENT_VPN_BINARY="$NEUTRON_BIN_DIR/neutron-vpn-agent"
10 10
 VPN_PLUGIN="neutron.services.vpn.plugin.VPNDriverPlugin"
11 11
 IPSEC_PACKAGE=${IPSEC_PACKAGE:-"openswan"}
12 12
 
13
-function neutron_vpn_install_agent_packages() {
13
+function neutron_vpn_install_agent_packages {
14 14
     install_package $IPSEC_PACKAGE
15 15
 }
16 16
 
17
-function neutron_vpn_configure_common() {
17
+function neutron_vpn_configure_common {
18 18
     _neutron_service_plugin_class_add $VPN_PLUGIN
19 19
 }
20 20
 
21
-function neutron_vpn_stop() {
21
+function neutron_vpn_stop {
22 22
     local ipsec_data_dir=$DATA_DIR/neutron/ipsec
23 23
     local pids
24 24
     if [ -d $ipsec_data_dir ]; then
... ...
@@ -7,7 +7,7 @@ set +o xtrace
7 7
 
8 8
 source $TOP_DIR/lib/neutron_plugins/ovs_base
9 9
 
10
-function setup_integration_bridge() {
10
+function setup_integration_bridge {
11 11
     _neutron_ovs_base_setup_bridge $OVS_BRIDGE
12 12
     # Set manager to NSX controller (1st of list)
13 13
     if [[ "$NSX_CONTROLLERS" != "" ]]; then
... ...
@@ -20,24 +20,24 @@ function setup_integration_bridge() {
20 20
     sudo ovs-vsctl set-manager ssl:$OVS_MGR_IP
21 21
 }
22 22
 
23
-function is_neutron_ovs_base_plugin() {
23
+function is_neutron_ovs_base_plugin {
24 24
     # NSX uses OVS, but not the l3-agent
25 25
     return 0
26 26
 }
27 27
 
28
-function neutron_plugin_create_nova_conf() {
28
+function neutron_plugin_create_nova_conf {
29 29
     # if n-cpu is enabled, then setup integration bridge
30 30
     if is_service_enabled n-cpu; then
31 31
         setup_integration_bridge
32 32
     fi
33 33
 }
34 34
 
35
-function neutron_plugin_install_agent_packages() {
35
+function neutron_plugin_install_agent_packages {
36 36
     # VMware NSX Plugin does not run q-agt, but it currently needs dhcp and metadata agents
37 37
     _neutron_ovs_base_install_agent_packages
38 38
 }
39 39
 
40
-function neutron_plugin_configure_common() {
40
+function neutron_plugin_configure_common {
41 41
     Q_PLUGIN_CONF_PATH=etc/neutron/plugins/vmware
42 42
     Q_PLUGIN_CONF_FILENAME=nsx.ini
43 43
     Q_DB_NAME="neutron_nsx"
... ...
@@ -45,29 +45,29 @@ function neutron_plugin_configure_common() {
45 45
     Q_PLUGIN_CLASS="neutron.plugins.nicira.NeutronPlugin.NvpPluginV2"
46 46
 }
47 47
 
48
-function neutron_plugin_configure_debug_command() {
48
+function neutron_plugin_configure_debug_command {
49 49
     sudo ovs-vsctl --no-wait -- --may-exist add-br $PUBLIC_BRIDGE
50 50
     iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge "$PUBLIC_BRIDGE"
51 51
 }
52 52
 
53
-function neutron_plugin_configure_dhcp_agent() {
53
+function neutron_plugin_configure_dhcp_agent {
54 54
     setup_integration_bridge
55 55
     iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
56 56
     iniset $Q_DHCP_CONF_FILE DEFAULT enable_metadata_network True
57 57
     iniset $Q_DHCP_CONF_FILE DEFAULT ovs_use_veth True
58 58
 }
59 59
 
60
-function neutron_plugin_configure_l3_agent() {
60
+function neutron_plugin_configure_l3_agent {
61 61
     # VMware NSX plugin does not run L3 agent
62 62
     die $LINENO "q-l3 should must not be executed with VMware NSX plugin!"
63 63
 }
64 64
 
65
-function neutron_plugin_configure_plugin_agent() {
65
+function neutron_plugin_configure_plugin_agent {
66 66
     # VMware NSX plugin does not run L2 agent
67 67
     die $LINENO "q-agt must not be executed with VMware NSX plugin!"
68 68
 }
69 69
 
70
-function neutron_plugin_configure_service() {
70
+function neutron_plugin_configure_service {
71 71
     if [[ "$MAX_LP_PER_BRIDGED_LS" != "" ]]; then
72 72
         iniset /$Q_PLUGIN_CONF_FILE nsx max_lp_per_bridged_ls $MAX_LP_PER_BRIDGED_LS
73 73
     fi
... ...
@@ -132,17 +132,17 @@ function neutron_plugin_configure_service() {
132 132
     fi
133 133
 }
134 134
 
135
-function neutron_plugin_setup_interface_driver() {
135
+function neutron_plugin_setup_interface_driver {
136 136
     local conf_file=$1
137 137
     iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
138 138
 }
139 139
 
140
-function has_neutron_plugin_security_group() {
140
+function has_neutron_plugin_security_group {
141 141
     # 0 means True here
142 142
     return 0
143 143
 }
144 144
 
145
-function neutron_plugin_check_adv_test_requirements() {
145
+function neutron_plugin_check_adv_test_requirements {
146 146
     is_service_enabled q-dhcp && return 0
147 147
 }
148 148
 
... ...
@@ -8,11 +8,11 @@ set +o xtrace
8 8
 BS_FL_CONTROLLERS_PORT=${BS_FL_CONTROLLERS_PORT:-localhost:80}
9 9
 BS_FL_OF_PORT=${BS_FL_OF_PORT:-6633}
10 10
 
11
-function configure_bigswitch_floodlight() {
11
+function configure_bigswitch_floodlight {
12 12
     :
13 13
 }
14 14
 
15
-function init_bigswitch_floodlight() {
15
+function init_bigswitch_floodlight {
16 16
     install_neutron_agent_packages
17 17
 
18 18
     echo -n "Installing OVS managed by the openflow controllers:"
... ...
@@ -32,19 +32,19 @@ function init_bigswitch_floodlight() {
32 32
     sudo ovs-vsctl --no-wait set-controller ${OVS_BRIDGE} ${ctrls}
33 33
 }
34 34
 
35
-function install_bigswitch_floodlight() {
35
+function install_bigswitch_floodlight {
36 36
     :
37 37
 }
38 38
 
39
-function start_bigswitch_floodlight() {
39
+function start_bigswitch_floodlight {
40 40
     :
41 41
 }
42 42
 
43
-function stop_bigswitch_floodlight() {
43
+function stop_bigswitch_floodlight {
44 44
     :
45 45
 }
46 46
 
47
-function check_bigswitch_floodlight() {
47
+function check_bigswitch_floodlight {
48 48
     :
49 49
 }
50 50
 
... ...
@@ -20,28 +20,28 @@ MIDONET_CLIENT_DIR=${MIDONET_CLIENT_DIR:-$MIDONET_DIR/python-midonetclient}
20 20
 MY_XTRACE=$(set +o | grep xtrace)
21 21
 set +o xtrace
22 22
 
23
-function configure_midonet() {
23
+function configure_midonet {
24 24
     :
25 25
 }
26 26
 
27
-function init_midonet() {
27
+function init_midonet {
28 28
     :
29 29
 }
30 30
 
31
-function install_midonet() {
31
+function install_midonet {
32 32
     git_clone $MIDONET_CLIENT_REPO $MIDONET_CLIENT_DIR $MIDONET_CLIENT_BRANCH
33 33
     export PYTHONPATH=$MIDONET_CLIENT_DIR/src:$PYTHONPATH
34 34
 }
35 35
 
36
-function start_midonet() {
36
+function start_midonet {
37 37
     :
38 38
 }
39 39
 
40
-function stop_midonet() {
40
+function stop_midonet {
41 41
     :
42 42
 }
43 43
 
44
-function check_midonet() {
44
+function check_midonet {
45 45
     :
46 46
 }
47 47
 
... ...
@@ -21,14 +21,14 @@ RYU_APPS=${RYU_APPS:-ryu.app.simple_isolation,ryu.app.rest}
21 21
 # configure_ryu can be called multiple times as neutron_pluing/ryu may call
22 22
 # this function for neutron-ryu-agent
23 23
 _RYU_CONFIGURED=${_RYU_CONFIGURED:-False}
24
-function configure_ryu() {
24
+function configure_ryu {
25 25
     if [[ "$_RYU_CONFIGURED" == "False" ]]; then
26 26
         setup_develop $RYU_DIR
27 27
         _RYU_CONFIGURED=True
28 28
     fi
29 29
 }
30 30
 
31
-function init_ryu() {
31
+function init_ryu {
32 32
     RYU_CONF_DIR=/etc/ryu
33 33
     if [[ ! -d $RYU_CONF_DIR ]]; then
34 34
         sudo mkdir -p $RYU_CONF_DIR
... ...
@@ -60,22 +60,22 @@ neutron_controller_addr=tcp:$RYU_OFP_HOST:$RYU_OFP_PORT
60 60
 # Make this function idempotent and avoid cloning same repo many times
61 61
 # with RECLONE=yes
62 62
 _RYU_INSTALLED=${_RYU_INSTALLED:-False}
63
-function install_ryu() {
63
+function install_ryu {
64 64
     if [[ "$_RYU_INSTALLED" == "False" ]]; then
65 65
         git_clone $RYU_REPO $RYU_DIR $RYU_BRANCH
66 66
         _RYU_INSTALLED=True
67 67
     fi
68 68
 }
69 69
 
70
-function start_ryu() {
70
+function start_ryu {
71 71
     screen_it ryu "cd $RYU_DIR && $RYU_DIR/bin/ryu-manager --config-file $RYU_CONF"
72 72
 }
73 73
 
74
-function stop_ryu() {
74
+function stop_ryu {
75 75
     :
76 76
 }
77 77
 
78
-function check_ryu() {
78
+function check_ryu {
79 79
     :
80 80
 }
81 81
 
... ...
@@ -31,7 +31,7 @@ TREMA_SS_CONFIG=$TREMA_SS_ETC_DIR/sliceable.conf
31 31
 TREMA_SS_APACHE_CONFIG=/etc/apache2/sites-available/sliceable_switch.conf
32 32
 
33 33
 # configure_trema - Set config files, create data dirs, etc
34
-function configure_trema() {
34
+function configure_trema {
35 35
     # prepare dir
36 36
     for d in $TREMA_SS_ETC_DIR $TREMA_SS_DB_DIR $TREMA_SS_SCRIPT_DIR; do
37 37
         sudo mkdir -p $d
... ...
@@ -41,7 +41,7 @@ function configure_trema() {
41 41
 }
42 42
 
43 43
 # init_trema - Initialize databases, etc.
44
-function init_trema() {
44
+function init_trema {
45 45
     local _pwd=$(pwd)
46 46
 
47 47
     # Initialize databases for Sliceable Switch
... ...
@@ -70,7 +70,7 @@ function init_trema() {
70 70
         $TREMA_SS_CONFIG
71 71
 }
72 72
 
73
-function gem_install() {
73
+function gem_install {
74 74
     [[ "$OFFLINE" = "True" ]] && return
75 75
     [ -n "$RUBYGEMS_CMD" ] || get_gem_command
76 76
 
... ...
@@ -79,7 +79,7 @@ function gem_install() {
79 79
     sudo $RUBYGEMS_CMD install $pkg
80 80
 }
81 81
 
82
-function get_gem_command() {
82
+function get_gem_command {
83 83
     # Trema requires ruby 1.8, so gem1.8 is checked first
84 84
     RUBYGEMS_CMD=$(which gem1.8 || which gem)
85 85
     if [ -z "$RUBYGEMS_CMD" ]; then
... ...
@@ -87,7 +87,7 @@ function get_gem_command() {
87 87
     fi
88 88
 }
89 89
 
90
-function install_trema() {
90
+function install_trema {
91 91
     # Trema
92 92
     gem_install trema
93 93
     # Sliceable Switch
... ...
@@ -97,7 +97,7 @@ function install_trema() {
97 97
     make -C $TREMA_DIR/apps/sliceable_switch
98 98
 }
99 99
 
100
-function start_trema() {
100
+function start_trema {
101 101
     # APACHE_NAME is defined in init_horizon (in lib/horizon)
102 102
     restart_service $APACHE_NAME
103 103
 
... ...
@@ -105,11 +105,11 @@ function start_trema() {
105 105
         trema run -d -c $TREMA_SS_CONFIG
106 106
 }
107 107
 
108
-function stop_trema() {
108
+function stop_trema {
109 109
     sudo TREMA_TMP=$TREMA_TMP_DIR trema killall
110 110
 }
111 111
 
112
-function check_trema() {
112
+function check_trema {
113 113
     :
114 114
 }
115 115
 
... ...
@@ -22,11 +22,11 @@ NSX_GATEWAY_NETWORK_INTERFACE=${NSX_GATEWAY_NETWORK_INTERFACE:-eth2}
22 22
 # is invoked by unstack.sh
23 23
 FLOATING_RANGE=${FLOATING_RANGE:-172.24.4.0/24}
24 24
 
25
-function configure_vmware_nsx() {
25
+function configure_vmware_nsx {
26 26
     :
27 27
 }
28 28
 
29
-function init_vmware_nsx() {
29
+function init_vmware_nsx {
30 30
     if ! is_set NSX_GATEWAY_NETWORK_CIDR; then
31 31
         NSX_GATEWAY_NETWORK_CIDR=$PUBLIC_NETWORK_GATEWAY/${FLOATING_RANGE#*/}
32 32
         echo "The IP address to set on br-ex was not specified. "
... ...
@@ -52,15 +52,15 @@ function init_vmware_nsx() {
52 52
     sudo ip addr add dev $PUBLIC_BRIDGE $NSX_GATEWAY_NETWORK_CIDR
53 53
 }
54 54
 
55
-function install_vmware_nsx() {
55
+function install_vmware_nsx {
56 56
     :
57 57
 }
58 58
 
59
-function start_vmware_nsx() {
59
+function start_vmware_nsx {
60 60
     :
61 61
 }
62 62
 
63
-function stop_vmware_nsx() {
63
+function stop_vmware_nsx {
64 64
     if ! is_set NSX_GATEWAY_NETWORK_CIDR; then
65 65
         NSX_GATEWAY_NETWORK_CIDR=$PUBLIC_NETWORK_GATEWAY/${FLOATING_RANGE#*/}
66 66
         echo "The IP address expected on br-ex was not specified. "
... ...
@@ -78,7 +78,7 @@ function stop_vmware_nsx() {
78 78
     done
79 79
 }
80 80
 
81
-function check_vmware_nsx() {
81
+function check_vmware_nsx {
82 82
     neutron-check-nsx-config $NEUTRON_CONF_DIR/plugins/vmware/nsx.ini
83 83
 }
84 84
 
... ...
@@ -144,7 +144,7 @@ function is_n-cell_enabled {
144 144
 }
145 145
 
146 146
 # Helper to clean iptables rules
147
-function clean_iptables() {
147
+function clean_iptables {
148 148
     # Delete rules
149 149
     sudo iptables -S -v | sed "s/-c [0-9]* [0-9]* //g" | grep "nova" | grep "\-A" |  sed "s/-A/-D/g" | awk '{print "sudo iptables",$0}' | bash
150 150
     # Delete nat rules
... ...
@@ -157,7 +157,7 @@ function clean_iptables() {
157 157
 
158 158
 # cleanup_nova() - Remove residual data files, anything left over from previous
159 159
 # runs that a clean run would need to clean up
160
-function cleanup_nova() {
160
+function cleanup_nova {
161 161
     if is_service_enabled n-cpu; then
162 162
         # Clean iptables from previous runs
163 163
         clean_iptables
... ...
@@ -191,7 +191,7 @@ function cleanup_nova() {
191 191
 }
192 192
 
193 193
 # configure_nova_rootwrap() - configure Nova's rootwrap
194
-function configure_nova_rootwrap() {
194
+function configure_nova_rootwrap {
195 195
     # Deploy new rootwrap filters files (owned by root).
196 196
     # Wipe any existing rootwrap.d files first
197 197
     if [[ -d $NOVA_CONF_DIR/rootwrap.d ]]; then
... ...
@@ -219,7 +219,7 @@ function configure_nova_rootwrap() {
219 219
 }
220 220
 
221 221
 # configure_nova() - Set config files, create data dirs, etc
222
-function configure_nova() {
222
+function configure_nova {
223 223
     # Put config files in ``/etc/nova`` for everyone to find
224 224
     if [[ ! -d $NOVA_CONF_DIR ]]; then
225 225
         sudo mkdir -p $NOVA_CONF_DIR
... ...
@@ -367,7 +367,7 @@ create_nova_accounts() {
367 367
 }
368 368
 
369 369
 # create_nova_conf() - Create a new nova.conf file
370
-function create_nova_conf() {
370
+function create_nova_conf {
371 371
     # Remove legacy ``nova.conf``
372 372
     rm -f $NOVA_DIR/bin/nova.conf
373 373
 
... ...
@@ -515,7 +515,7 @@ function create_nova_conf() {
515 515
     iniset $NOVA_CONF DEFAULT glance_api_servers "$GLANCE_HOSTPORT"
516 516
 }
517 517
 
518
-function init_nova_cells() {
518
+function init_nova_cells {
519 519
     if is_service_enabled n-cell; then
520 520
         cp $NOVA_CONF $NOVA_CELLS_CONF
521 521
         iniset $NOVA_CELLS_CONF DEFAULT sql_connection `database_connection_url $NOVA_CELLS_DB`
... ...
@@ -542,14 +542,14 @@ function init_nova_cells() {
542 542
 }
543 543
 
544 544
 # create_nova_cache_dir() - Part of the init_nova() process
545
-function create_nova_cache_dir() {
545
+function create_nova_cache_dir {
546 546
     # Create cache dir
547 547
     sudo mkdir -p $NOVA_AUTH_CACHE_DIR
548 548
     sudo chown $STACK_USER $NOVA_AUTH_CACHE_DIR
549 549
     rm -f $NOVA_AUTH_CACHE_DIR/*
550 550
 }
551 551
 
552
-function create_nova_conf_nova_network() {
552
+function create_nova_conf_nova_network {
553 553
     iniset $NOVA_CONF DEFAULT network_manager "nova.network.manager.$NETWORK_MANAGER"
554 554
     iniset $NOVA_CONF DEFAULT public_interface "$PUBLIC_INTERFACE"
555 555
     iniset $NOVA_CONF DEFAULT vlan_interface "$VLAN_INTERFACE"
... ...
@@ -560,14 +560,14 @@ function create_nova_conf_nova_network() {
560 560
 }
561 561
 
562 562
 # create_nova_keys_dir() - Part of the init_nova() process
563
-function create_nova_keys_dir() {
563
+function create_nova_keys_dir {
564 564
     # Create keys dir
565 565
     sudo mkdir -p ${NOVA_STATE_PATH}/keys
566 566
     sudo chown -R $STACK_USER ${NOVA_STATE_PATH}
567 567
 }
568 568
 
569 569
 # init_nova() - Initialize databases, etc.
570
-function init_nova() {
570
+function init_nova {
571 571
     # All nova components talk to a central database.
572 572
     # Only do this step once on the API node for an entire cluster.
573 573
     if is_service_enabled $DATABASE_BACKENDS && is_service_enabled n-api; then
... ...
@@ -596,14 +596,14 @@ function init_nova() {
596 596
 }
597 597
 
598 598
 # install_novaclient() - Collect source and prepare
599
-function install_novaclient() {
599
+function install_novaclient {
600 600
     git_clone $NOVACLIENT_REPO $NOVACLIENT_DIR $NOVACLIENT_BRANCH
601 601
     setup_develop $NOVACLIENT_DIR
602 602
     sudo install -D -m 0644 -o $STACK_USER {$NOVACLIENT_DIR/tools/,/etc/bash_completion.d/}nova.bash_completion
603 603
 }
604 604
 
605 605
 # install_nova() - Collect source and prepare
606
-function install_nova() {
606
+function install_nova {
607 607
     if is_service_enabled n-cpu && [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then
608 608
         install_nova_hypervisor
609 609
     fi
... ...
@@ -638,7 +638,7 @@ function install_nova() {
638 638
 }
639 639
 
640 640
 # start_nova_api() - Start the API process ahead of other things
641
-function start_nova_api() {
641
+function start_nova_api {
642 642
     # Get right service port for testing
643 643
     local service_port=$NOVA_SERVICE_PORT
644 644
     if is_service_enabled tls-proxy; then
... ...
@@ -658,7 +658,7 @@ function start_nova_api() {
658 658
 }
659 659
 
660 660
 # start_nova_compute() - Start the compute process
661
-function start_nova_compute() {
661
+function start_nova_compute {
662 662
     if is_service_enabled n-cell; then
663 663
         local compute_cell_conf=$NOVA_CELLS_CONF
664 664
     else
... ...
@@ -693,7 +693,7 @@ function start_nova_compute() {
693 693
 }
694 694
 
695 695
 # start_nova() - Start running processes, including screen
696
-function start_nova_rest() {
696
+function start_nova_rest {
697 697
     local api_cell_conf=$NOVA_CONF
698 698
     if is_service_enabled n-cell; then
699 699
         local compute_cell_conf=$NOVA_CELLS_CONF
... ...
@@ -722,13 +722,13 @@ function start_nova_rest() {
722 722
         screen_it n-obj "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-objectstore --config-file $api_cell_conf"
723 723
 }
724 724
 
725
-function start_nova() {
725
+function start_nova {
726 726
     start_nova_compute
727 727
     start_nova_rest
728 728
 }
729 729
 
730 730
 # stop_nova() - Stop running processes (non-screen)
731
-function stop_nova() {
731
+function stop_nova {
732 732
     # Kill the nova screen windows
733 733
     # Some services are listed here twice since more than one instance
734 734
     # of a service may be running in certain configs.
... ...
@@ -33,13 +33,13 @@ STUB_NETWORK=${STUB_NETWORK:-False}
33 33
 # ------------
34 34
 
35 35
 # clean_nova_hypervisor - Clean up an installation
36
-function cleanup_nova_hypervisor() {
36
+function cleanup_nova_hypervisor {
37 37
     # This function intentionally left blank
38 38
     :
39 39
 }
40 40
 
41 41
 # configure_nova_hypervisor - Set config files, create data dirs, etc
42
-function configure_nova_hypervisor() {
42
+function configure_nova_hypervisor {
43 43
     configure_baremetal_nova_dirs
44 44
 
45 45
     iniset $NOVA_CONF baremetal sql_connection `database_connection_url nova_bm`
... ...
@@ -67,19 +67,19 @@ function configure_nova_hypervisor() {
67 67
 }
68 68
 
69 69
 # install_nova_hypervisor() - Install external components
70
-function install_nova_hypervisor() {
70
+function install_nova_hypervisor {
71 71
     # This function intentionally left blank
72 72
     :
73 73
 }
74 74
 
75 75
 # start_nova_hypervisor - Start any required external services
76
-function start_nova_hypervisor() {
76
+function start_nova_hypervisor {
77 77
     # This function intentionally left blank
78 78
     :
79 79
 }
80 80
 
81 81
 # stop_nova_hypervisor - Stop any external services
82
-function stop_nova_hypervisor() {
82
+function stop_nova_hypervisor {
83 83
     # This function intentionally left blank
84 84
     :
85 85
 }
... ...
@@ -44,7 +44,7 @@ DOCKER_APT_REPO=${DOCKER_APT_REPO:-https://get.docker.io/ubuntu}
44 44
 # ------------
45 45
 
46 46
 # clean_nova_hypervisor - Clean up an installation
47
-function cleanup_nova_hypervisor() {
47
+function cleanup_nova_hypervisor {
48 48
     stop_service docker
49 49
 
50 50
     # Clean out work area
... ...
@@ -52,13 +52,13 @@ function cleanup_nova_hypervisor() {
52 52
 }
53 53
 
54 54
 # configure_nova_hypervisor - Set config files, create data dirs, etc
55
-function configure_nova_hypervisor() {
55
+function configure_nova_hypervisor {
56 56
     iniset $NOVA_CONF DEFAULT compute_driver docker.DockerDriver
57 57
     iniset $GLANCE_API_CONF DEFAULT container_formats ami,ari,aki,bare,ovf,docker
58 58
 }
59 59
 
60 60
 # install_nova_hypervisor() - Install external components
61
-function install_nova_hypervisor() {
61
+function install_nova_hypervisor {
62 62
     # So far this is Ubuntu only
63 63
     if ! is_ubuntu; then
64 64
         die $LINENO "Docker is only supported on Ubuntu at this time"
... ...
@@ -77,7 +77,7 @@ function install_nova_hypervisor() {
77 77
 }
78 78
 
79 79
 # start_nova_hypervisor - Start any required external services
80
-function start_nova_hypervisor() {
80
+function start_nova_hypervisor {
81 81
     local docker_pid
82 82
     read docker_pid <$DOCKER_PID_FILE
83 83
     if [[ -z $docker_pid ]] || ! ps -p $docker_pid | grep [d]ocker; then
... ...
@@ -111,7 +111,7 @@ function start_nova_hypervisor() {
111 111
 }
112 112
 
113 113
 # stop_nova_hypervisor - Stop any external services
114
-function stop_nova_hypervisor() {
114
+function stop_nova_hypervisor {
115 115
     # Stop the docker registry container
116 116
     docker kill $(docker ps | grep docker-registry | cut -d' ' -f1)
117 117
 }
... ...
@@ -27,13 +27,13 @@ set +o xtrace
27 27
 # ------------
28 28
 
29 29
 # clean_nova_hypervisor - Clean up an installation
30
-function cleanup_nova_hypervisor() {
30
+function cleanup_nova_hypervisor {
31 31
     # This function intentionally left blank
32 32
     :
33 33
 }
34 34
 
35 35
 # configure_nova_hypervisor - Set config files, create data dirs, etc
36
-function configure_nova_hypervisor() {
36
+function configure_nova_hypervisor {
37 37
     iniset $NOVA_CONF DEFAULT compute_driver "nova.virt.fake.FakeDriver"
38 38
     # Disable arbitrary limits
39 39
     iniset $NOVA_CONF DEFAULT quota_instances -1
... ...
@@ -51,19 +51,19 @@ function configure_nova_hypervisor() {
51 51
 }
52 52
 
53 53
 # install_nova_hypervisor() - Install external components
54
-function install_nova_hypervisor() {
54
+function install_nova_hypervisor {
55 55
     # This function intentionally left blank
56 56
     :
57 57
 }
58 58
 
59 59
 # start_nova_hypervisor - Start any required external services
60
-function start_nova_hypervisor() {
60
+function start_nova_hypervisor {
61 61
     # This function intentionally left blank
62 62
     :
63 63
 }
64 64
 
65 65
 # stop_nova_hypervisor - Stop any external services
66
-function stop_nova_hypervisor() {
66
+function stop_nova_hypervisor {
67 67
     # This function intentionally left blank
68 68
     :
69 69
 }
... ...
@@ -31,13 +31,13 @@ ENABLE_FILE_INJECTION=${ENABLE_FILE_INJECTION:-False}
31 31
 # ------------
32 32
 
33 33
 # clean_nova_hypervisor - Clean up an installation
34
-function cleanup_nova_hypervisor() {
34
+function cleanup_nova_hypervisor {
35 35
     # This function intentionally left blank
36 36
     :
37 37
 }
38 38
 
39 39
 # configure_nova_hypervisor - Set config files, create data dirs, etc
40
-function configure_nova_hypervisor() {
40
+function configure_nova_hypervisor {
41 41
     if is_service_enabled neutron && is_neutron_ovs_base_plugin && ! sudo grep -q '^cgroup_device_acl' $QEMU_CONF; then
42 42
         # Add /dev/net/tun to cgroup_device_acls, needed for type=ethernet interfaces
43 43
         cat <<EOF | sudo tee -a $QEMU_CONF
... ...
@@ -135,7 +135,7 @@ EOF
135 135
 }
136 136
 
137 137
 # install_nova_hypervisor() - Install external components
138
-function install_nova_hypervisor() {
138
+function install_nova_hypervisor {
139 139
     if is_ubuntu; then
140 140
         install_package kvm
141 141
         install_package libvirt-bin
... ...
@@ -165,13 +165,13 @@ function install_nova_hypervisor() {
165 165
 }
166 166
 
167 167
 # start_nova_hypervisor - Start any required external services
168
-function start_nova_hypervisor() {
168
+function start_nova_hypervisor {
169 169
     # This function intentionally left blank
170 170
     :
171 171
 }
172 172
 
173 173
 # stop_nova_hypervisor - Stop any external services
174
-function stop_nova_hypervisor() {
174
+function stop_nova_hypervisor {
175 175
     # This function intentionally left blank
176 176
     :
177 177
 }
... ...
@@ -27,13 +27,13 @@ set +o xtrace
27 27
 # ------------
28 28
 
29 29
 # clean_nova_hypervisor - Clean up an installation
30
-function cleanup_nova_hypervisor() {
30
+function cleanup_nova_hypervisor {
31 31
     # This function intentionally left blank
32 32
     :
33 33
 }
34 34
 
35 35
 # configure_nova_hypervisor - Set config files, create data dirs, etc
36
-function configure_nova_hypervisor() {
36
+function configure_nova_hypervisor {
37 37
     iniset $NOVA_CONF DEFAULT compute_driver "openvz.OpenVzDriver"
38 38
     iniset $NOVA_CONF DEFAULT connection_type "openvz"
39 39
     LIBVIRT_FIREWALL_DRIVER=${LIBVIRT_FIREWALL_DRIVER:-"nova.virt.libvirt.firewall.IptablesFirewallDriver"}
... ...
@@ -41,19 +41,19 @@ function configure_nova_hypervisor() {
41 41
 }
42 42
 
43 43
 # install_nova_hypervisor() - Install external components
44
-function install_nova_hypervisor() {
44
+function install_nova_hypervisor {
45 45
     # This function intentionally left blank
46 46
     :
47 47
 }
48 48
 
49 49
 # start_nova_hypervisor - Start any required external services
50
-function start_nova_hypervisor() {
50
+function start_nova_hypervisor {
51 51
     # This function intentionally left blank
52 52
     :
53 53
 }
54 54
 
55 55
 # stop_nova_hypervisor - Stop any external services
56
-function stop_nova_hypervisor() {
56
+function stop_nova_hypervisor {
57 57
     # This function intentionally left blank
58 58
     :
59 59
 }
... ...
@@ -27,13 +27,13 @@ set +o xtrace
27 27
 # ------------
28 28
 
29 29
 # clean_nova_hypervisor - Clean up an installation
30
-function cleanup_nova_hypervisor() {
30
+function cleanup_nova_hypervisor {
31 31
     # This function intentionally left blank
32 32
     :
33 33
 }
34 34
 
35 35
 # configure_nova_hypervisor - Set config files, create data dirs, etc
36
-function configure_nova_hypervisor() {
36
+function configure_nova_hypervisor {
37 37
     iniset $NOVA_CONF DEFAULT compute_driver "vmwareapi.VMwareVCDriver"
38 38
     VMWAREAPI_USER=${VMWAREAPI_USER:-"root"}
39 39
     iniset $NOVA_CONF vmware host_ip "$VMWAREAPI_IP"
... ...
@@ -46,19 +46,19 @@ function configure_nova_hypervisor() {
46 46
 }
47 47
 
48 48
 # install_nova_hypervisor() - Install external components
49
-function install_nova_hypervisor() {
49
+function install_nova_hypervisor {
50 50
     # This function intentionally left blank
51 51
     :
52 52
 }
53 53
 
54 54
 # start_nova_hypervisor - Start any required external services
55
-function start_nova_hypervisor() {
55
+function start_nova_hypervisor {
56 56
     # This function intentionally left blank
57 57
     :
58 58
 }
59 59
 
60 60
 # stop_nova_hypervisor - Stop any external services
61
-function stop_nova_hypervisor() {
61
+function stop_nova_hypervisor {
62 62
     # This function intentionally left blank
63 63
     :
64 64
 }
... ...
@@ -37,13 +37,13 @@ VNCSERVER_PROXYCLIENT_ADDRESS=${VNCSERVER_PROXYCLIENT_ADDRESS=169.254.0.1}
37 37
 # ------------
38 38
 
39 39
 # clean_nova_hypervisor - Clean up an installation
40
-function cleanup_nova_hypervisor() {
40
+function cleanup_nova_hypervisor {
41 41
     # This function intentionally left blank
42 42
     :
43 43
 }
44 44
 
45 45
 # configure_nova_hypervisor - Set config files, create data dirs, etc
46
-function configure_nova_hypervisor() {
46
+function configure_nova_hypervisor {
47 47
     if [ -z "$XENAPI_CONNECTION_URL" ]; then
48 48
         die $LINENO "XENAPI_CONNECTION_URL is not specified"
49 49
     fi
... ...
@@ -87,19 +87,19 @@ CRONTAB
87 87
 }
88 88
 
89 89
 # install_nova_hypervisor() - Install external components
90
-function install_nova_hypervisor() {
90
+function install_nova_hypervisor {
91 91
     # This function intentionally left blank
92 92
     :
93 93
 }
94 94
 
95 95
 # start_nova_hypervisor - Start any required external services
96
-function start_nova_hypervisor() {
96
+function start_nova_hypervisor {
97 97
     # This function intentionally left blank
98 98
     :
99 99
 }
100 100
 
101 101
 # stop_nova_hypervisor - Stop any external services
102
-function stop_nova_hypervisor() {
102
+function stop_nova_hypervisor {
103 103
     # This function intentionally left blank
104 104
     :
105 105
 }
... ...
@@ -33,7 +33,7 @@ TASKFLOW_DIR=$DEST/taskflow
33 33
 # ------------
34 34
 
35 35
 # install_oslo() - Collect source and prepare
36
-function install_oslo() {
36
+function install_oslo {
37 37
     # TODO(sdague): remove this once we get to Icehouse, this just makes
38 38
     # for a smoother transition of existing users.
39 39
     cleanup_oslo
... ...
@@ -64,7 +64,7 @@ function install_oslo() {
64 64
 }
65 65
 
66 66
 # cleanup_oslo() - purge possibly old versions of oslo
67
-function cleanup_oslo() {
67
+function cleanup_oslo {
68 68
     # this means we've got an old oslo installed, lets get rid of it
69 69
     if ! python -c 'import oslo.config' 2>/dev/null; then
70 70
         echo "Found old oslo.config... removing to ensure consistency"
... ...
@@ -25,7 +25,7 @@ set +o xtrace
25 25
 
26 26
 # Make sure we only have one rpc backend enabled.
27 27
 # Also check the specified rpc backend is available on your platform.
28
-function check_rpc_backend() {
28
+function check_rpc_backend {
29 29
     local rpc_needed=1
30 30
     # We rely on the fact that filenames in lib/* match the service names
31 31
     # that can be passed as arguments to is_service_enabled.
... ...
@@ -91,7 +91,7 @@ function cleanup_rpc_backend {
91 91
 }
92 92
 
93 93
 # install rpc backend
94
-function install_rpc_backend() {
94
+function install_rpc_backend {
95 95
     if is_service_enabled rabbit; then
96 96
         # Install rabbitmq-server
97 97
         # the temp file is necessary due to LP: #878600
... ...
@@ -135,7 +135,7 @@ function install_rpc_backend() {
135 135
 }
136 136
 
137 137
 # restart the rpc backend
138
-function restart_rpc_backend() {
138
+function restart_rpc_backend {
139 139
     if is_service_enabled rabbit; then
140 140
         # Start rabbitmq-server
141 141
         echo_summary "Starting RabbitMQ"
... ...
@@ -165,7 +165,7 @@ function restart_rpc_backend() {
165 165
 }
166 166
 
167 167
 # iniset cofiguration
168
-function iniset_rpc_backend() {
168
+function iniset_rpc_backend {
169 169
     local package=$1
170 170
     local file=$2
171 171
     local section=$3
... ...
@@ -193,7 +193,7 @@ function iniset_rpc_backend() {
193 193
 
194 194
 # Check if qpid can be used on the current distro.
195 195
 # qpid_is_supported
196
-function qpid_is_supported() {
196
+function qpid_is_supported {
197 197
     if [[ -z "$DISTRO" ]]; then
198 198
         GetDistro
199 199
     fi
... ...
@@ -55,7 +55,7 @@ TEMPEST_SERVICES+=,savanna
55 55
 # Tenant      User       Roles
56 56
 # ------------------------------
57 57
 # service     savanna    admin
58
-function create_savanna_accounts() {
58
+function create_savanna_accounts {
59 59
 
60 60
     SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
61 61
     ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
... ...
@@ -88,14 +88,14 @@ function create_savanna_accounts() {
88 88
 
89 89
 # cleanup_savanna() - Remove residual data files, anything left over from
90 90
 # previous runs that would need to clean up.
91
-function cleanup_savanna() {
91
+function cleanup_savanna {
92 92
 
93 93
     # Cleanup auth cache dir
94 94
     sudo rm -rf $SAVANNA_AUTH_CACHE_DIR
95 95
 }
96 96
 
97 97
 # configure_savanna() - Set config files, create data dirs, etc
98
-function configure_savanna() {
98
+function configure_savanna {
99 99
 
100 100
     if [[ ! -d $SAVANNA_CONF_DIR ]]; then
101 101
         sudo mkdir -p $SAVANNA_CONF_DIR
... ...
@@ -142,18 +142,18 @@ function configure_savanna() {
142 142
 }
143 143
 
144 144
 # install_savanna() - Collect source and prepare
145
-function install_savanna() {
145
+function install_savanna {
146 146
     git_clone $SAVANNA_REPO $SAVANNA_DIR $SAVANNA_BRANCH
147 147
     setup_develop $SAVANNA_DIR
148 148
 }
149 149
 
150 150
 # start_savanna() - Start running processes, including screen
151
-function start_savanna() {
151
+function start_savanna {
152 152
     screen_it savanna "cd $SAVANNA_DIR && $SAVANNA_BIN_DIR/savanna-api --config-file $SAVANNA_CONF_FILE"
153 153
 }
154 154
 
155 155
 # stop_savanna() - Stop running processes
156
-function stop_savanna() {
156
+function stop_savanna {
157 157
     # Kill the Savanna screen windows
158 158
     screen -S $SCREEN_NAME -p savanna -X kill
159 159
 }
... ...
@@ -35,7 +35,7 @@ SAVANNA_PYTHONCLIENT_DIR=$DEST/python-savannaclient
35 35
 # Functions
36 36
 # ---------
37 37
 
38
-function configure_savanna_dashboard() {
38
+function configure_savanna_dashboard {
39 39
 
40 40
     echo -e "AUTO_ASSIGNMENT_ENABLED = False" >> $HORIZON_DIR/openstack_dashboard/local/local_settings.py
41 41
     echo -e "HORIZON_CONFIG['dashboards'] += ('savanna',)" >> $HORIZON_DIR/openstack_dashboard/settings.py
... ...
@@ -47,19 +47,19 @@ function configure_savanna_dashboard() {
47 47
 }
48 48
 
49 49
 # install_savanna_dashboard() - Collect source and prepare
50
-function install_savanna_dashboard() {
50
+function install_savanna_dashboard {
51 51
     install_python_savannaclient
52 52
     git_clone $SAVANNA_DASHBOARD_REPO $SAVANNA_DASHBOARD_DIR $SAVANNA_DASHBOARD_BRANCH
53 53
     setup_develop $SAVANNA_DASHBOARD_DIR
54 54
 }
55 55
 
56
-function install_python_savannaclient() {
56
+function install_python_savannaclient {
57 57
     git_clone $SAVANNA_PYTHONCLIENT_REPO $SAVANNA_PYTHONCLIENT_DIR $SAVANNA_PYTHONCLIENT_BRANCH
58 58
     setup_develop $SAVANNA_PYTHONCLIENT_DIR
59 59
 }
60 60
 
61 61
 # Cleanup file settings.py from Savanna
62
-function cleanup_savanna_dashboard() {
62
+function cleanup_savanna_dashboard {
63 63
     sed -i '/savanna/d' $HORIZON_DIR/openstack_dashboard/settings.py
64 64
 }
65 65
 
... ...
@@ -34,7 +34,7 @@ PECAN_DIR=$DEST/pecan
34 34
 # ------------
35 35
 
36 36
 # install_stackforge() - Collect source and prepare
37
-function install_stackforge() {
37
+function install_stackforge {
38 38
     # TODO(sdague): remove this once we get to Icehouse, this just makes
39 39
     # for a smoother transition of existing users.
40 40
     cleanup_stackforge
... ...
@@ -47,7 +47,7 @@ function install_stackforge() {
47 47
 }
48 48
 
49 49
 # cleanup_stackforge() - purge possibly old versions of stackforge libraries
50
-function cleanup_stackforge() {
50
+function cleanup_stackforge {
51 51
     # this means we've got an old version installed, lets get rid of it
52 52
     # otherwise python hates itself
53 53
     for lib in wsme pecan; do
... ...
@@ -126,7 +126,7 @@ function is_swift_enabled {
126 126
 }
127 127
 
128 128
 # cleanup_swift() - Remove residual data files
129
-function cleanup_swift() {
129
+function cleanup_swift {
130 130
     rm -f ${SWIFT_CONF_DIR}{*.builder,*.ring.gz,backups/*.builder,backups/*.ring.gz}
131 131
     if egrep -q ${SWIFT_DATA_DIR}/drives/sdb1 /proc/mounts; then
132 132
         sudo umount ${SWIFT_DATA_DIR}/drives/sdb1
... ...
@@ -141,7 +141,7 @@ function cleanup_swift() {
141 141
 }
142 142
 
143 143
 # _cleanup_swift_apache_wsgi() - Remove wsgi files, disable and remove apache vhost file
144
-function _cleanup_swift_apache_wsgi() {
144
+function _cleanup_swift_apache_wsgi {
145 145
     sudo rm -f $SWIFT_APACHE_WSGI_DIR/*.wsgi
146 146
     disable_apache_site proxy-server
147 147
     for node_number in ${SWIFT_REPLICAS_SEQ}; do
... ...
@@ -154,7 +154,7 @@ function _cleanup_swift_apache_wsgi() {
154 154
 }
155 155
 
156 156
 # _config_swift_apache_wsgi() - Set WSGI config files of Swift
157
-function _config_swift_apache_wsgi() {
157
+function _config_swift_apache_wsgi {
158 158
     sudo mkdir -p ${SWIFT_APACHE_WSGI_DIR}
159 159
     local apache_vhost_dir=/etc/${APACHE_NAME}/$APACHE_CONF_DIR
160 160
     local proxy_port=${SWIFT_DEFAULT_BIND_PORT:-8080}
... ...
@@ -233,7 +233,7 @@ function _config_swift_apache_wsgi() {
233 233
 
234 234
 # This function generates an object/container/account configuration
235 235
 # emulating 4 nodes on different ports
236
-function generate_swift_config() {
236
+function generate_swift_config {
237 237
     local swift_node_config=$1
238 238
     local node_id=$2
239 239
     local bind_port=$3
... ...
@@ -272,7 +272,7 @@ function generate_swift_config() {
272 272
 
273 273
 
274 274
 # configure_swift() - Set config files, create data dirs and loop image
275
-function configure_swift() {
275
+function configure_swift {
276 276
     local swift_pipeline="${SWIFT_EXTRAS_MIDDLEWARE_NO_AUTH}"
277 277
     local node_number
278 278
     local swift_node_config
... ...
@@ -460,7 +460,7 @@ EOF
460 460
 }
461 461
 
462 462
 # create_swift_disk - Create Swift backing disk
463
-function create_swift_disk() {
463
+function create_swift_disk {
464 464
     local node_number
465 465
 
466 466
     # First do a bit of setup by creating the directories and
... ...
@@ -520,7 +520,7 @@ function create_swift_disk() {
520 520
 # swifttenanttest1   swiftusertest3     anotherrole
521 521
 # swifttenanttest2   swiftusertest2     admin
522 522
 
523
-function create_swift_accounts() {
523
+function create_swift_accounts {
524 524
     # Defines specific passwords used by tools/create_userrc.sh
525 525
     SWIFTUSERTEST1_PASSWORD=testing
526 526
     SWIFTUSERTEST2_PASSWORD=testing2
... ...
@@ -578,7 +578,7 @@ function create_swift_accounts() {
578 578
 }
579 579
 
580 580
 # init_swift() - Initialize rings
581
-function init_swift() {
581
+function init_swift {
582 582
     local node_number
583 583
     # Make sure to kill all swift processes first
584 584
     swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true
... ...
@@ -612,7 +612,7 @@ function init_swift() {
612 612
     rm -f $SWIFT_AUTH_CACHE_DIR/*
613 613
 }
614 614
 
615
-function install_swift() {
615
+function install_swift {
616 616
     git_clone $SWIFT_REPO $SWIFT_DIR $SWIFT_BRANCH
617 617
     setup_develop $SWIFT_DIR
618 618
     if is_apache_enabled_service swift; then
... ...
@@ -620,13 +620,13 @@ function install_swift() {
620 620
     fi
621 621
 }
622 622
 
623
-function install_swiftclient() {
623
+function install_swiftclient {
624 624
     git_clone $SWIFTCLIENT_REPO $SWIFTCLIENT_DIR $SWIFTCLIENT_BRANCH
625 625
     setup_develop $SWIFTCLIENT_DIR
626 626
 }
627 627
 
628 628
 # start_swift() - Start running processes, including screen
629
-function start_swift() {
629
+function start_swift {
630 630
     # (re)start rsyslog
631 631
     restart_service rsyslog
632 632
     # (re)start memcached to make sure we have a clean memcache.
... ...
@@ -674,7 +674,7 @@ function start_swift() {
674 674
 }
675 675
 
676 676
 # stop_swift() - Stop running processes (non-screen)
677
-function stop_swift() {
677
+function stop_swift {
678 678
 
679 679
     if is_apache_enabled_service swift; then
680 680
         swift-init --run-dir=${SWIFT_DATA_DIR}/run rest stop && return 0
... ...
@@ -70,7 +70,7 @@ IPV6_ENABLED=$(trueorfalse True $IPV6_ENABLED)
70 70
 # ---------
71 71
 
72 72
 # configure_tempest() - Set config files, create data dirs, etc
73
-function configure_tempest() {
73
+function configure_tempest {
74 74
     setup_develop $TEMPEST_DIR
75 75
     local image_lines
76 76
     local images
... ...
@@ -359,12 +359,12 @@ function configure_tempest() {
359 359
 }
360 360
 
361 361
 # install_tempest() - Collect source and prepare
362
-function install_tempest() {
362
+function install_tempest {
363 363
     git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
364 364
 }
365 365
 
366 366
 # init_tempest() - Initialize ec2 images
367
-function init_tempest() {
367
+function init_tempest {
368 368
     local base_image_name=cirros-0.3.1-x86_64
369 369
     # /opt/stack/devstack/files/images/cirros-0.3.1-x86_64-uec
370 370
     local image_dir="$FILES/images/${base_image_name}-uec"
... ...
@@ -45,7 +45,7 @@ function is_XXXX_enabled {
45 45
 
46 46
 # cleanup_XXXX() - Remove residual data files, anything left over from previous
47 47
 # runs that a clean run would need to clean up
48
-function cleanup_XXXX() {
48
+function cleanup_XXXX {
49 49
     # kill instances (nova)
50 50
     # delete image files (glance)
51 51
     # This function intentionally left blank
... ...
@@ -53,7 +53,7 @@ function cleanup_XXXX() {
53 53
 }
54 54
 
55 55
 # configure_XXXX() - Set config files, create data dirs, etc
56
-function configure_XXXX() {
56
+function configure_XXXX {
57 57
     # sudo python setup.py deploy
58 58
     # iniset $XXXX_CONF ...
59 59
     # This function intentionally left blank
... ...
@@ -61,26 +61,26 @@ function configure_XXXX() {
61 61
 }
62 62
 
63 63
 # init_XXXX() - Initialize databases, etc.
64
-function init_XXXX() {
64
+function init_XXXX {
65 65
     # clean up from previous (possibly aborted) runs
66 66
     # create required data files
67 67
     :
68 68
 }
69 69
 
70 70
 # install_XXXX() - Collect source and prepare
71
-function install_XXXX() {
71
+function install_XXXX {
72 72
     # git clone xxx
73 73
     :
74 74
 }
75 75
 
76 76
 # start_XXXX() - Start running processes, including screen
77
-function start_XXXX() {
77
+function start_XXXX {
78 78
     # screen_it XXXX "cd $XXXX_DIR && $XXXX_DIR/bin/XXXX-bin"
79 79
     :
80 80
 }
81 81
 
82 82
 # stop_XXXX() - Stop running processes (non-screen)
83
-function stop_XXXX() {
83
+function stop_XXXX {
84 84
     # FIXME(dtroyer): stop only our screen screen window?
85 85
     :
86 86
 }
... ...
@@ -61,7 +61,7 @@ STUD_CIPHERS='TLSv1+HIGH:!DES:!aNULL:!eNULL:@STRENGTH'
61 61
 OPENSSL=${OPENSSL:-/usr/bin/openssl}
62 62
 
63 63
 # Do primary CA configuration
64
-function configure_CA() {
64
+function configure_CA {
65 65
     # build common config file
66 66
 
67 67
     # Verify ``TLS_IP`` is good
... ...
@@ -73,7 +73,7 @@ function configure_CA() {
73 73
 
74 74
 # Creates a new CA directory structure
75 75
 # create_CA_base ca-dir
76
-function create_CA_base() {
76
+function create_CA_base {
77 77
     local ca_dir=$1
78 78
 
79 79
     if [[ -d $ca_dir ]]; then
... ...
@@ -92,7 +92,7 @@ function create_CA_base() {
92 92
 
93 93
 # Create a new CA configuration file
94 94
 # create_CA_config ca-dir common-name
95
-function create_CA_config() {
95
+function create_CA_config {
96 96
     local ca_dir=$1
97 97
     local common_name=$2
98 98
 
... ...
@@ -145,7 +145,7 @@ keyUsage                = cRLSign, keyCertSign
145 145
 
146 146
 # Create a new signing configuration file
147 147
 # create_signing_config ca-dir
148
-function create_signing_config() {
148
+function create_signing_config {
149 149
     local ca_dir=$1
150 150
 
151 151
     echo "
... ...
@@ -225,7 +225,7 @@ function init_cert {
225 225
 
226 226
 # make_cert creates and signs a new certificate with the given commonName and CA
227 227
 # make_cert ca-dir cert-name "common-name" ["alt-name" ...]
228
-function make_cert() {
228
+function make_cert {
229 229
     local ca_dir=$1
230 230
     local cert_name=$2
231 231
     local common_name=$3
... ...
@@ -261,7 +261,7 @@ function make_cert() {
261 261
 
262 262
 # Make an intermediate CA to sign everything else
263 263
 # make_int_CA ca-dir signing-ca-dir
264
-function make_int_CA() {
264
+function make_int_CA {
265 265
     local ca_dir=$1
266 266
     local signing_ca_dir=$2
267 267
 
... ...
@@ -291,7 +291,7 @@ function make_int_CA() {
291 291
 
292 292
 # Make a root CA to sign other CAs
293 293
 # make_root_CA ca-dir
294
-function make_root_CA() {
294
+function make_root_CA {
295 295
     local ca_dir=$1
296 296
 
297 297
     # Create the root CA
... ...
@@ -319,7 +319,7 @@ function make_root_CA() {
319 319
 # is a short-circuit boolean, i.e it returns on the first match.
320 320
 #
321 321
 # Uses global ``SSL_ENABLED_SERVICES``
322
-function is_ssl_enabled_service() {
322
+function is_ssl_enabled_service {
323 323
     services=$@
324 324
     for service in ${services}; do
325 325
         [[ ,${SSL_ENABLED_SERVICES}, =~ ,${service}, ]] && return 0
... ...
@@ -337,7 +337,7 @@ function is_ssl_enabled_service() {
337 337
 # example for keystone this would be KEYSTONE_SSL_CERT, KEYSTONE_SSL_KEY and
338 338
 # KEYSTONE_SSL_CA. If it does not find these certificates the program will
339 339
 # quit.
340
-function ensure_certificates() {
340
+function ensure_certificates {
341 341
     local service=$1
342 342
 
343 343
     local cert_var="${service}_SSL_CERT"
... ...
@@ -362,7 +362,7 @@ function ensure_certificates() {
362 362
 
363 363
 # Starts the TLS proxy for the given IP/ports
364 364
 # start_tls_proxy front-host front-port back-host back-port
365
-function start_tls_proxy() {
365
+function start_tls_proxy {
366 366
     local f_host=$1
367 367
     local f_port=$2
368 368
     local b_host=$3
... ...
@@ -53,7 +53,7 @@ function is_trove_enabled {
53 53
 }
54 54
 
55 55
 # setup_trove_logging() - Adds logging configuration to conf files
56
-function setup_trove_logging() {
56
+function setup_trove_logging {
57 57
     local CONF=$1
58 58
     iniset $CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
59 59
     iniset $CONF DEFAULT use_syslog $SYSLOG
... ...
@@ -69,7 +69,7 @@ function setup_trove_logging() {
69 69
 # ------------------------------------------------------------------
70 70
 # service              trove     admin        # if enabled
71 71
 
72
-create_trove_accounts() {
72
+function create_trove_accounts {
73 73
     # Trove
74 74
     SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
75 75
     SERVICE_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
... ...
@@ -106,19 +106,19 @@ create_trove_accounts() {
106 106
 
107 107
 # cleanup_trove() - Remove residual data files, anything left over from previous
108 108
 # runs that a clean run would need to clean up
109
-function cleanup_trove() {
109
+function cleanup_trove {
110 110
     #Clean up dirs
111 111
     rm -fr $TROVE_AUTH_CACHE_DIR/*
112 112
     rm -fr $TROVE_CONF_DIR/*
113 113
 }
114 114
 
115 115
 # configure_troveclient() - Set config files, create data dirs, etc
116
-function configure_troveclient() {
116
+function configure_troveclient {
117 117
     setup_develop $TROVECLIENT_DIR
118 118
 }
119 119
 
120 120
 # configure_trove() - Set config files, create data dirs, etc
121
-function configure_trove() {
121
+function configure_trove {
122 122
     setup_develop $TROVE_DIR
123 123
 
124 124
     # Create the trove conf dir and cache dirs if they don't exist
... ...
@@ -182,17 +182,17 @@ function configure_trove() {
182 182
 }
183 183
 
184 184
 # install_troveclient() - Collect source and prepare
185
-function install_troveclient() {
185
+function install_troveclient {
186 186
     git_clone $TROVECLIENT_REPO $TROVECLIENT_DIR $TROVECLIENT_BRANCH
187 187
 }
188 188
 
189 189
 # install_trove() - Collect source and prepare
190
-function install_trove() {
190
+function install_trove {
191 191
     git_clone $TROVE_REPO $TROVE_DIR $TROVE_BRANCH
192 192
 }
193 193
 
194 194
 # init_trove() - Initializes Trove Database as a Service
195
-function init_trove() {
195
+function init_trove {
196 196
     #(Re)Create trove db
197 197
     recreate_database trove utf8
198 198
 
... ...
@@ -201,14 +201,14 @@ function init_trove() {
201 201
 }
202 202
 
203 203
 # start_trove() - Start running processes, including screen
204
-function start_trove() {
204
+function start_trove {
205 205
     screen_it tr-api "cd $TROVE_DIR; $TROVE_BIN_DIR/trove-api --config-file=$TROVE_CONF_DIR/trove.conf --debug 2>&1"
206 206
     screen_it tr-tmgr "cd $TROVE_DIR; $TROVE_BIN_DIR/trove-taskmanager --config-file=$TROVE_CONF_DIR/trove-taskmanager.conf --debug 2>&1"
207 207
     screen_it tr-cond "cd $TROVE_DIR; $TROVE_BIN_DIR/trove-conductor --config-file=$TROVE_CONF_DIR/trove-conductor.conf --debug 2>&1"
208 208
 }
209 209
 
210 210
 # stop_trove() - Stop running processes
211
-function stop_trove() {
211
+function stop_trove {
212 212
     # Kill the trove screen windows
213 213
     for serv in tr-api tr-tmgr tr-cond; do
214 214
         screen_stop $serv
... ...
@@ -464,7 +464,7 @@ fi
464 464
 # -----------------
465 465
 
466 466
 # Draw a spinner so the user knows something is happening
467
-function spinner() {
467
+function spinner {
468 468
     local delay=0.75
469 469
     local spinstr='/-\|'
470 470
     printf "..." >&3
... ...
@@ -479,7 +479,7 @@ function spinner() {
479 479
 
480 480
 # Echo text to the log file, summary log file and stdout
481 481
 # echo_summary "something to say"
482
-function echo_summary() {
482
+function echo_summary {
483 483
     if [[ -t 3 && "$VERBOSE" != "True" ]]; then
484 484
         kill >/dev/null 2>&1 $LAST_SPINNER_PID
485 485
         if [ ! -z "$LAST_SPINNER_PID" ]; then
... ...
@@ -495,7 +495,7 @@ function echo_summary() {
495 495
 
496 496
 # Echo text only to stdout, no log files
497 497
 # echo_nolog "something not for the logs"
498
-function echo_nolog() {
498
+function echo_nolog {
499 499
     echo $@ >&3
500 500
 }
501 501
 
... ...
@@ -42,7 +42,7 @@ fi
42 42
 
43 43
 echo "Testing enable_service()"
44 44
 
45
-function test_enable_service() {
45
+function test_enable_service {
46 46
     local start="$1"
47 47
     local add="$2"
48 48
     local finish="$3"
... ...
@@ -68,7 +68,7 @@ test_enable_service 'a,b,c' c 'a,b,c'
68 68
 test_enable_service 'a,b,-c' c 'a,b'
69 69
 test_enable_service 'a,b,c' -c 'a,b'
70 70
 
71
-function test_disable_service() {
71
+function test_disable_service {
72 72
     local start="$1"
73 73
     local del="$2"
74 74
     local finish="$3"
... ...
@@ -109,7 +109,7 @@ fi
109 109
 echo "Testing disable_negated_services()"
110 110
 
111 111
 
112
-function test_disable_negated_services() {
112
+function test_disable_negated_services {
113 113
     local start="$1"
114 114
     local finish="$2"
115 115
 
... ...
@@ -12,7 +12,7 @@ source $TOP/lib/config
12 12
 
13 13
 # check_result() tests and reports the result values
14 14
 # check_result "actual" "expected"
15
-function check_result() {
15
+function check_result {
16 16
     local actual=$1
17 17
     local expected=$2
18 18
     if [[ "$actual" == "$expected" ]]; then
... ...
@@ -26,7 +26,7 @@ TEST_1C_ADD="[eee]
26 26
 type=new
27 27
 multi = foo2"
28 28
 
29
-function create_test1c() {
29
+function create_test1c {
30 30
     cat >test1c.conf <<EOF
31 31
 [eee]
32 32
 # original comment
... ...
@@ -34,7 +34,7 @@ type=original
34 34
 EOF
35 35
 }
36 36
 
37
-function create_test2a() {
37
+function create_test2a {
38 38
     cat >test2a.conf <<EOF
39 39
 [ddd]
40 40
 # original comment
... ...
@@ -102,6 +102,21 @@ def check_indents(line):
102 102
         if (len(m.group('indent')) % 4) != 0:
103 103
             print_error('E003: Indent not multiple of 4', line)
104 104
 
105
+def check_function_decl(line):
106
+    failed = False
107
+    if line.startswith("function"):
108
+        if not re.search('^function [\w-]* \{$', line):
109
+            failed = True
110
+    else:
111
+        # catch the case without "function", e.g.
112
+        # things like '^foo() {'
113
+        if re.search('^\s*?\(\)\s*?\{', line):
114
+            failed = True
115
+
116
+    if failed:
117
+        print_error('E020: Function declaration not in format '
118
+                    ' "^function name {$"', line)
119
+
105 120
 
106 121
 def starts_multiline(line):
107 122
     m = re.search("[^<]<<\s*(?P<token>\w+)", line)
... ...
@@ -169,6 +184,7 @@ def check_files(files, verbose):
169 169
         check_indents(logical_line)
170 170
         check_for_do(logical_line)
171 171
         check_if_then(logical_line)
172
+        check_function_decl(logical_line)
172 173
 
173 174
         prev_line = logical_line
174 175
         prev_lineno = fileinput.filelineno()
... ...
@@ -17,7 +17,7 @@ PXEDIR=${PXEDIR:-/opt/ramstack/pxe}
17 17
 PROGDIR=`dirname $0`
18 18
 
19 19
 # Clean up any resources that may be in use
20
-cleanup() {
20
+function cleanup {
21 21
     set +o errexit
22 22
 
23 23
     # Mop up temporary files
... ...
@@ -14,7 +14,7 @@ if [ ! "$#" -eq "1" ]; then
14 14
 fi
15 15
 
16 16
 # Clean up any resources that may be in use
17
-cleanup() {
17
+function cleanup {
18 18
     set +o errexit
19 19
 
20 20
     # Mop up temporary files
... ...
@@ -87,7 +87,7 @@ fi
87 87
 # Finds and returns full device path for the next available NBD device.
88 88
 # Exits script if error connecting or none free.
89 89
 # map_nbd image
90
-function map_nbd() {
90
+function map_nbd {
91 91
     for i in `seq 0 15`; do
92 92
         if [ ! -e /sys/block/nbd$i/pid ]; then
93 93
             NBD=/dev/nbd$i
... ...
@@ -20,7 +20,7 @@ if ! egrep -q "oneiric" /etc/lsb-release; then
20 20
 fi
21 21
 
22 22
 # Clean up resources that may be in use
23
-cleanup() {
23
+function cleanup {
24 24
     set +o errexit
25 25
 
26 26
     if [ -n "$MNT_DIR" ]; then
... ...
@@ -13,7 +13,7 @@ DEST_DIR=${1:-/tmp/syslinux-boot}
13 13
 PXEDIR=${PXEDIR:-/opt/ramstack/pxe}
14 14
 
15 15
 # Clean up any resources that may be in use
16
-cleanup() {
16
+function cleanup {
17 17
     set +o errexit
18 18
 
19 19
     # Mop up temporary files
... ...
@@ -22,7 +22,7 @@ cd $TOP_DIR
22 22
 source ./stackrc
23 23
 
24 24
 # Echo usage
25
-usage() {
25
+function usage {
26 26
     echo "Add stack user and keys"
27 27
     echo ""
28 28
     echo "Usage: $0 [full path to raw uec base image]"
... ...
@@ -11,8 +11,7 @@ set -o xtrace
11 11
 
12 12
 ACCOUNT_DIR=./accrc
13 13
 
14
-display_help()
15
-{
14
+function display_help {
16 15
 cat <<EOF
17 16
 
18 17
 usage: $0 <options..>
... ...
@@ -151,7 +150,7 @@ if ! nova x509-get-root-cert "$EUCALYPTUS_CERT"; then
151 151
 fi
152 152
 
153 153
 
154
-function add_entry(){
154
+function add_entry {
155 155
     local user_id=$1
156 156
     local user_name=$2
157 157
     local tenant_id=$3
... ...
@@ -213,7 +212,7 @@ EOF
213 213
 }
214 214
 
215 215
 #admin users expected
216
-function create_or_get_tenant(){
216
+function create_or_get_tenant {
217 217
     local tenant_name=$1
218 218
     local tenant_id=`keystone tenant-list | awk '/\|[[:space:]]*'"$tenant_name"'[[:space:]]*\|.*\|/ {print $2}'`
219 219
     if [ -n "$tenant_id" ]; then
... ...
@@ -223,7 +222,7 @@ function create_or_get_tenant(){
223 223
     fi
224 224
 }
225 225
 
226
-function create_or_get_role(){
226
+function create_or_get_role {
227 227
     local role_name=$1
228 228
     local role_id=`keystone role-list| awk '/\|[[:space:]]*'"$role_name"'[[:space:]]*\|/ {print $2}'`
229 229
     if [ -n "$role_id" ]; then
... ...
@@ -234,7 +233,7 @@ function create_or_get_role(){
234 234
 }
235 235
 
236 236
 # Provides empty string when the user does not exists
237
-function get_user_id(){
237
+function get_user_id {
238 238
     local user_name=$1
239 239
     keystone user-list | awk '/^\|[^|]*\|[[:space:]]*'"$user_name"'[[:space:]]*\|.*\|/ {print $2}'
240 240
 }
... ...
@@ -40,7 +40,7 @@ FILES=$TOP_DIR/files
40 40
 # ---------------
41 41
 
42 42
 # get_package_path python-package    # in import notation
43
-function get_package_path() {
43
+function get_package_path {
44 44
     local package=$1
45 45
     echo $(python -c "import os; import $package; print(os.path.split(os.path.realpath($package.__file__))[0])")
46 46
 }
... ...
@@ -18,7 +18,7 @@ TOP_DIR=$(cd $TOOLS_DIR/..; pwd)
18 18
 set -o errexit
19 19
 set -o xtrace
20 20
 
21
-usage() {
21
+function usage {
22 22
     echo "Usage: $0 - Download and prepare Ubuntu UEC images"
23 23
     echo ""
24 24
     echo "$0 [-r rootsize] release imagefile [kernel]"
... ...
@@ -31,7 +31,7 @@ usage() {
31 31
 }
32 32
 
33 33
 # Clean up any resources that may be in use
34
-cleanup() {
34
+function cleanup {
35 35
     set +o errexit
36 36
 
37 37
     # Mop up temporary files
... ...
@@ -61,7 +61,7 @@ fi
61 61
 # -----
62 62
 
63 63
 # git_report <dir>
64
-function git_report() {
64
+function git_report {
65 65
     local dir=$1
66 66
     local proj ref branch head
67 67
     if [[ -d $dir/.git ]]; then
... ...
@@ -22,7 +22,7 @@ if [ -e vpnrc ]; then
22 22
 fi
23 23
 
24 24
 # Do some IP manipulation
25
-function cidr2netmask() {
25
+function cidr2netmask {
26 26
     set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0
27 27
     if [[ $1 -gt 1 ]]; then
28 28
         shift $1
... ...
@@ -50,7 +50,7 @@ VPN_CLIENT_DHCP="${VPN_CLIENT_DHCP:-net.1 net.254}"
50 50
 VPN_DIR=/etc/openvpn
51 51
 CA_DIR=$VPN_DIR/easy-rsa
52 52
 
53
-usage() {
53
+function usage {
54 54
     echo "$0 - OpenVPN install and certificate generation"
55 55
     echo ""
56 56
     echo "$0 --client name"
... ...
@@ -102,7 +102,7 @@ if [ ! -r $CA_DIR/keys/dh1024.pem ]; then
102 102
     openvpn --genkey --secret $CA_DIR/keys/ta.key  ## Build a TLS key
103 103
 fi
104 104
 
105
-do_server() {
105
+function do_server {
106 106
     NAME=$1
107 107
     # Generate server certificate
108 108
     $CA_DIR/pkitool --server $NAME
... ...
@@ -162,7 +162,7 @@ EOF
162 162
     /etc/init.d/openvpn restart
163 163
 }
164 164
 
165
-do_client() {
165
+function do_client {
166 166
     NAME=$1
167 167
     # Generate a client certificate
168 168
     $CA_DIR/pkitool $NAME
... ...
@@ -50,7 +50,7 @@ PIP_TAR_URL=https://pypi.python.org/packages/source/p/pip/pip-$INSTALL_PIP_VERSI
50 50
 GetDistro
51 51
 echo "Distro: $DISTRO"
52 52
 
53
-function get_versions() {
53
+function get_versions {
54 54
     PIP=$(which pip 2>/dev/null || which pip-python 2>/dev/null || true)
55 55
     if [[ -n $PIP ]]; then
56 56
         PIP_VERSION=$($PIP --version | awk '{ print $2}')
... ...
@@ -61,7 +61,7 @@ function get_versions() {
61 61
 }
62 62
 
63 63
 
64
-function install_get_pip() {
64
+function install_get_pip {
65 65
     if [[ ! -r $FILES/get-pip.py ]]; then
66 66
         (cd $FILES; \
67 67
             curl -O $PIP_GET_PIP_URL; \
... ...
@@ -70,7 +70,7 @@ function install_get_pip() {
70 70
     sudo -E python $FILES/get-pip.py
71 71
 }
72 72
 
73
-function install_pip_tarball() {
73
+function install_pip_tarball {
74 74
     (cd $FILES; \
75 75
         curl -O $PIP_TAR_URL; \
76 76
         tar xvfz pip-$INSTALL_PIP_VERSION.tar.gz 1>/dev/null; \
... ...
@@ -5,7 +5,7 @@ CONFIGURATION=$2
5 5
 ADAPTER=$3
6 6
 RC=$4
7 7
 
8
-function usage() {
8
+function usage {
9 9
     echo "Usage: $0 -  Build a configuration"
10 10
     echo ""
11 11
     echo "$0 [EXECUTOR_NUMBER] [CONFIGURATION] [ADAPTER] [RC (optional)]"
... ...
@@ -9,7 +9,7 @@ CONFIGURATION=$2
9 9
 ADAPTER=$3
10 10
 RC=$4
11 11
 
12
-function usage() {
12
+function usage {
13 13
     echo "Usage: $0 - Build a test configuration"
14 14
     echo ""
15 15
     echo "$0 [EXECUTOR_NUMBER] [CONFIGURATION] [ADAPTER] [RC (optional)]"
... ...
@@ -8,7 +8,7 @@ CONFIGURATION=$2
8 8
 ADAPTER=$3
9 9
 RC=$4
10 10
 
11
-function usage() {
11
+function usage {
12 12
     echo "Usage: $0 - Build a test configuration"
13 13
     echo ""
14 14
     echo "$0 [EXECUTOR_NUMBER] [CONFIGURATION] [ADAPTER] [RC (optional)]"
... ...
@@ -4,7 +4,7 @@ EXECUTOR_NUMBER=$1
4 4
 ADAPTER=$2
5 5
 RC=$3
6 6
 
7
-function usage() {
7
+function usage {
8 8
     echo "Usage: $0 - Run a test"
9 9
     echo ""
10 10
     echo "$0 [EXECUTOR_NUMBER] [ADAPTER] [RC (optional)]"
... ...
@@ -16,7 +16,7 @@ TOP_DIR=`cd $TOOLS_DIR/..; pwd`
16 16
 cd $TOP_DIR
17 17
 
18 18
 # Echo usage
19
-usage() {
19
+function usage {
20 20
     echo "Cache OpenStack dependencies on a uec image to speed up performance."
21 21
     echo ""
22 22
     echo "Usage: $0 [full path to raw uec base image]"
... ...
@@ -42,7 +42,7 @@ source xenrc
42 42
 #
43 43
 GUEST_NAME="$1"
44 44
 
45
-function _print_interface_config() {
45
+function _print_interface_config {
46 46
     local device_nr
47 47
     local ip_address
48 48
     local netmask
... ...
@@ -68,7 +68,7 @@ function _print_interface_config() {
68 68
     echo "  post-up ethtool -K $device tx off"
69 69
 }
70 70
 
71
-function print_interfaces_config() {
71
+function print_interfaces_config {
72 72
     echo "auto lo"
73 73
     echo "iface lo inet loopback"
74 74
 
... ...
@@ -166,7 +166,7 @@ TNAME="jeos_template_for_devstack"
166 166
 SNAME_TEMPLATE="jeos_snapshot_for_devstack"
167 167
 SNAME_FIRST_BOOT="before_first_boot"
168 168
 
169
-function wait_for_VM_to_halt() {
169
+function wait_for_VM_to_halt {
170 170
     set +x
171 171
     echo "Waiting for the VM to halt.  Progress in-VM can be checked with vncviewer:"
172 172
     mgmt_ip=$(echo $XENAPI_CONNECTION_URL | tr -d -c '1234567890.')
... ...
@@ -318,7 +318,7 @@ xe vm-snapshot vm="$GUEST_NAME" new-name-label="$SNAME_FIRST_BOOT"
318 318
 #
319 319
 xe vm-start vm="$GUEST_NAME"
320 320
 
321
-function ssh_no_check() {
321
+function ssh_no_check {
322 322
     ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$@"
323 323
 }
324 324
 
... ...
@@ -349,7 +349,7 @@ DOMID=$(get_domid "$GUEST_NAME")
349 349
 xenstore-write /local/domain/$DOMID/authorized_keys/$DOMZERO_USER "$(cat /root/dom0key.pub)"
350 350
 xenstore-chmod -u /local/domain/$DOMID/authorized_keys/$DOMZERO_USER r$DOMID
351 351
 
352
-function run_on_appliance() {
352
+function run_on_appliance {
353 353
     ssh \
354 354
         -i /root/dom0key \
355 355
         -o UserKnownHostsFile=/dev/null \
... ...
@@ -21,7 +21,7 @@ STACK_USER="$3"
21 21
 DOMZERO_USER="$4"
22 22
 
23 23
 
24
-function setup_domzero_user() {
24
+function setup_domzero_user {
25 25
     local username
26 26
 
27 27
     username="$1"