From 43973551930266f5b53b71a976fc24bb3c88fefe Mon Sep 17 00:00:00 2001 From: Norbert Illes Date: Thu, 25 Feb 2016 16:29:29 +0100 Subject: [PATCH] Fix bashate E002 violations This commit fixes bashate E002 (indents are only spaces, and not hard tabs) violations Partial-Bug: #1550203 Change-Id: I7d156d47023781be74e6fa8daef6ffc311b55d9d Signed-off-by: Norbert Illes --- ocf/NovaCompute | 196 ++++++++++++++++++---------------- ocf/NovaEvacuate | 210 ++++++++++++++++++++----------------- ocf/glance-api | 2 +- ocf/neutron-agent-dhcp | 10 +- ocf/neutron-agent-l3 | 10 +- ocf/neutron-metadata-agent | 4 +- ocf/neutron-server | 4 +- ocf/nova-cert | 28 ++--- ocf/nova-consoleauth | 28 ++--- ocf/nova-network | 28 ++--- ocf/nova-novnc | 2 +- ocf/nova-scheduler | 26 ++--- 12 files changed, 291 insertions(+), 257 deletions(-) diff --git a/ocf/NovaCompute b/ocf/NovaCompute index 5a8bfd4..e8affce 100644 --- a/ocf/NovaCompute +++ b/ocf/NovaCompute @@ -38,7 +38,7 @@ ####################################################################### meta_data() { - cat < @@ -156,12 +156,12 @@ END # don't exit on TERM, to test that lrmd makes sure that we do exit trap sigterm_handler TERM sigterm_handler() { - ocf_log info "They use TERM to bring us down. No such luck." - return + ocf_log info "They use TERM to bring us down. No such luck." + return } nova_usage() { - cat </dev/null) if [ $? = 1 ]; then - if [ "x${OCF_RESKEY_domain}" != x ]; then - NOVA_HOST=$(uname -n | awk -F. '{print $1}') - else - NOVA_HOST=$(uname -n) - fi + if [ "x${OCF_RESKEY_domain}" != x ]; then + NOVA_HOST=$(uname -n | awk -F. '{print $1}') + else + NOVA_HOST=$(uname -n) + fi fi # We only need to check a configured value, calculated ones are fine crudini --get /etc/nova/nova.conf DEFAULT host 2>/dev/null if [ $? = 0 ]; then - if [ "x${OCF_RESKEY_domain}" != x ]; then - short_host=$(uname -n | awk -F. '{print $1}') - if [ "x$NOVA_HOST" != "x${short_host}" ]; then - ocf_exit_reason "Invalid Nova host name, must be ${short_host} in order for instance recovery to function" - rc=$OCF_ERR_CONFIGURED - fi + if [ "x${OCF_RESKEY_domain}" != x ]; then + short_host=$(uname -n | awk -F. '{print $1}') + if [ "x$NOVA_HOST" != "x${short_host}" ]; then + ocf_exit_reason "Invalid Nova host name, must be ${short_host} in order for instance recovery to function" + rc=$OCF_ERR_CONFIGURED + fi - elif [ "x$NOVA_HOST" != "x$(uname -n)" ]; then + elif [ "x$NOVA_HOST" != "x$(uname -n)" ]; then ocf_exit_reason "Invalid Nova host name, must be $(uname -n) in order for instance recovery to function" - rc=$OCF_ERR_CONFIGURED - fi + rc=$OCF_ERR_CONFIGURED + fi fi if [ $rc != $OCF_SUCCESS ]; then - exit $rc + exit $rc fi return $rc } : ${OCF_RESKEY_evacuation_delay=120} case $__OCF_ACTION in -meta-data) meta_data - exit $OCF_SUCCESS - ;; -usage|help) nova_usage - exit $OCF_SUCCESS - ;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + nova_usage + exit $OCF_SUCCESS + ;; esac case $__OCF_ACTION in -start) nova_validate; nova_start;; -stop) nova_stop;; -monitor) nova_validate; nova_monitor;; -notify) nova_notify;; -validate-all) exit $OCF_SUCCESS;; -*) nova_usage - exit $OCF_ERR_UNIMPLEMENTED - ;; + start) + nova_validate + nova_start + ;; + stop) + nova_stop + ;; + monitor) + nova_validate + nova_monitor + ;; + notify) + nova_notify + ;; + validate-all) + exit $OCF_SUCCESS + ;; + *) + nova_usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac rc=$? ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc" diff --git a/ocf/NovaEvacuate b/ocf/NovaEvacuate index 55401c9..e5d83a1 100644 --- a/ocf/NovaEvacuate +++ b/ocf/NovaEvacuate @@ -38,7 +38,7 @@ ####################################################################### meta_data() { - cat < @@ -144,12 +144,12 @@ END # don't exit on TERM, to test that lrmd makes sure that we do exit trap sigterm_handler TERM sigterm_handler() { - ocf_log info "They use TERM to bring us down. No such luck." - return + ocf_log info "They use TERM to bring us down. No such luck." + return } evacuate_usage() { - cat <> \ - /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required diff --git a/ocf/neutron-agent-l3 b/ocf/neutron-agent-l3 index 4db7140..2b6be7e 100644 --- a/ocf/neutron-agent-l3 +++ b/ocf/neutron-agent-l3 @@ -221,10 +221,10 @@ neutron_l3_agent_monitor() { # check the connections according to the PID network_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` rc=$? - if [ $rc -ne 0 ]; then - ocf_log err "Neutron L3 Server is not connected to the Neutron server: $rc" - return $OCF_NOT_RUNNING - fi + if [ $rc -ne 0 ]; then + ocf_log err "Neutron L3 Server is not connected to the Neutron server: $rc" + return $OCF_NOT_RUNNING + fi ocf_log debug "OpenStack L3 Server (neutron-l3-agent) monitor succeeded" return $OCF_SUCCESS @@ -244,7 +244,7 @@ neutron_l3_agent_start() { # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ --config-file=$OCF_RESKEY_plugin_config --log-file=/var/log/neutron/l3-agent.log $OCF_RESKEY_additional_parameters"' >> \ - /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required diff --git a/ocf/neutron-metadata-agent b/ocf/neutron-metadata-agent index b3eb8ed..4485099 100644 --- a/ocf/neutron-metadata-agent +++ b/ocf/neutron-metadata-agent @@ -232,8 +232,8 @@ neutron_metadata_agent_start() { # Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - --config-file=$OCF_RESKEY_agent_config --log-file=/var/log/neutron/metadata.log $OCF_RESKEY_additional_parameters"' >> \ - /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + --config-file=$OCF_RESKEY_agent_config --log-file=/var/log/neutron/metadata.log $OCF_RESKEY_additional_parameters"' >> \ + /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required diff --git a/ocf/neutron-server b/ocf/neutron-server index 365ad6c..c3a5afa 100644 --- a/ocf/neutron-server +++ b/ocf/neutron-server @@ -285,8 +285,8 @@ neutron_server_start() { # Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - --config-file=$OCF_RESKEY_plugin_config --log-file=/var/log/neutron/server.log $OCF_RESKEY_additional_parameters"' >> \ - /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + --config-file=$OCF_RESKEY_plugin_config --log-file=/var/log/neutron/server.log $OCF_RESKEY_additional_parameters"' >> \ + /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required diff --git a/ocf/nova-cert b/ocf/nova-cert index a6547ce..cc1657a 100644 --- a/ocf/nova-cert +++ b/ocf/nova-cert @@ -250,26 +250,26 @@ nova_cert_monitor() { # Check the connections according to the PID. # We are sure to hit the cert process and not other nova process with the same connection behavior (for example nova-scheduler) - if ocf_is_true "$OCF_RESKEY_zeromq"; then - pid=`cat $OCF_RESKEY_pid` - cert_db_check=`netstat -punt | grep -s "$OCF_RESKEY_database_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` - rc_db=$? - if [ $rc_db -ne 0 ]; then - ocf_log err "Nova Cert is not connected to the database server: $rc_db" - return $OCF_NOT_RUNNING - fi - else + if ocf_is_true "$OCF_RESKEY_zeromq"; then + pid=`cat $OCF_RESKEY_pid` + cert_db_check=`netstat -punt | grep -s "$OCF_RESKEY_database_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` + rc_db=$? + if [ $rc_db -ne 0 ]; then + ocf_log err "Nova Cert is not connected to the database server: $rc_db" + return $OCF_NOT_RUNNING + fi + else pid=`cat $OCF_RESKEY_pid` # check the connections according to the PID cert_db_check=`netstat -punt | grep -s "$OCF_RESKEY_database_server_port" | grep -s "$pid" | grep -sq "ESTABLISHED"` rc_db=$? cert_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$pid" | grep -sq "ESTABLISHED"` rc_amqp=$? - if [ $rc_amqp -ne 0 ] || [ $rc_db -ne 0 ]; then - ocf_log err "Nova Cert is not connected to the AMQP server and/or the database server: AMQP connection test returned $rc_amqp and database connection test returned $rc_db" - return $OCF_NOT_RUNNING - fi - fi + if [ $rc_amqp -ne 0 ] || [ $rc_db -ne 0 ]; then + ocf_log err "Nova Cert is not connected to the AMQP server and/or the database server: AMQP connection test returned $rc_amqp and database connection test returned $rc_db" + return $OCF_NOT_RUNNING + fi + fi ocf_log debug "OpenStack Nova Cert (nova-cert) monitor succeeded" return $OCF_SUCCESS diff --git a/ocf/nova-consoleauth b/ocf/nova-consoleauth index bd446f2..a964a8c 100644 --- a/ocf/nova-consoleauth +++ b/ocf/nova-consoleauth @@ -250,26 +250,26 @@ nova_consoleauth_monitor() { # Check the connections according to the PID. # We are sure to hit the scheduler process and not other nova process with the same connection behavior (for example nova-scheduler) - if ocf_is_true "$OCF_RESKEY_zeromq"; then - pid=`cat $OCF_RESKEY_pid` - console_db_check=`netstat -punt | grep -s "$OCF_RESKEY_database_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` - rc_db=$? - if [ $rc_db -ne 0 ]; then - ocf_log err "Nova Console Auth is not connected to the database server: $rc_db" - return $OCF_NOT_RUNNING - fi - else + if ocf_is_true "$OCF_RESKEY_zeromq"; then + pid=`cat $OCF_RESKEY_pid` + console_db_check=`netstat -punt | grep -s "$OCF_RESKEY_database_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` + rc_db=$? + if [ $rc_db -ne 0 ]; then + ocf_log err "Nova Console Auth is not connected to the database server: $rc_db" + return $OCF_NOT_RUNNING + fi + else pid=`cat $OCF_RESKEY_pid` # check the connections according to the PID console_db_check=`netstat -punt | grep -s "$OCF_RESKEY_database_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` rc_db=$? console_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | egrep -s "$pid" | grep -qs "ESTABLISHED"` rc_amqp=$? - if [ $rc_amqp -ne 0 ] || [ $rc_db -ne 0 ]; then - ocf_log err "Nova Console Auth is not connected to the AMQP server and/or the database server: AMQP connection test returned $rc_amqp and database connection test returned $rc_db" - return $OCF_NOT_RUNNING - fi - fi + if [ $rc_amqp -ne 0 ] || [ $rc_db -ne 0 ]; then + ocf_log err "Nova Console Auth is not connected to the AMQP server and/or the database server: AMQP connection test returned $rc_amqp and database connection test returned $rc_db" + return $OCF_NOT_RUNNING + fi + fi ocf_log debug "OpenStack Nova Console Auth (nova-consoleauth) monitor succeeded" return $OCF_SUCCESS diff --git a/ocf/nova-network b/ocf/nova-network index 1312357..7541971 100644 --- a/ocf/nova-network +++ b/ocf/nova-network @@ -229,26 +229,26 @@ nova_network_monitor() { # Check the connections according to the PID. # We are sure to hit the scheduler process and not other nova process with the same connection behavior (for example nova-cert) - if ocf_is_true "$OCF_RESKEY_zeromq"; then - pid=`cat $OCF_RESKEY_pid` - network_db_check=`netstat -punt | grep -s "$OCF_RESKEY_database_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` - rc_db=$? - if [ $rc_db -ne 0 ]; then - ocf_log err "Nova Network is not connected to the database server: $rc_db" - return $OCF_NOT_RUNNING - fi - else + if ocf_is_true "$OCF_RESKEY_zeromq"; then + pid=`cat $OCF_RESKEY_pid` + network_db_check=`netstat -punt | grep -s "$OCF_RESKEY_database_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` + rc_db=$? + if [ $rc_db -ne 0 ]; then + ocf_log err "Nova Network is not connected to the database server: $rc_db" + return $OCF_NOT_RUNNING + fi + else pid=`cat $OCF_RESKEY_pid` # check the connections according to the PID network_db_check=`netstat -punt | grep -s "$OCF_RESKEY_database_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` rc_db=$? network_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` rc_amqp=$? - if [ $rc_amqp -ne 0 ] || [ $rc_db -ne 0 ]; then - ocf_log err "Nova Network is not connected to the AMQP server and/or the database server: AMQP connection test returned $rc_amqp and database connection test returned $rc_db" - return $OCF_NOT_RUNNING - fi - fi + if [ $rc_amqp -ne 0 ] || [ $rc_db -ne 0 ]; then + ocf_log err "Nova Network is not connected to the AMQP server and/or the database server: AMQP connection test returned $rc_amqp and database connection test returned $rc_db" + return $OCF_NOT_RUNNING + fi + fi ocf_log debug "OpenStack Nova Network (nova-network) monitor succeeded" return $OCF_SUCCESS diff --git a/ocf/nova-novnc b/ocf/nova-novnc index f507d5f..1240dde 100644 --- a/ocf/nova-novnc +++ b/ocf/nova-novnc @@ -213,7 +213,7 @@ nova_vnc_console_monitor() { # Check whether we are supposed to monitor by logging into nova-novncproxy # and do it if that's the case. - vnc_list_check=`netstat -a | grep -s "$OCF_RESKEY_console_port" | grep -qs "LISTEN"` + vnc_list_check=`netstat -a | grep -s "$OCF_RESKEY_console_port" | grep -qs "LISTEN"` rc=$? if [ $rc -ne 0 ]; then ocf_log err "Nova VNC Console doesn't seem to listen on his default port: $rc" diff --git a/ocf/nova-scheduler b/ocf/nova-scheduler index 8fc43b8..c54e9fd 100644 --- a/ocf/nova-scheduler +++ b/ocf/nova-scheduler @@ -251,24 +251,24 @@ nova_scheduler_monitor() { # Check the connections according to the PID. # We are sure to hit the scheduler process and not other nova process with the same connection behavior (for example nova-cert) if ocf_is_true "$OCF_RESKEY_zeromq"; then - pid=`cat $OCF_RESKEY_pid` - scheduler_db_check=`netstat -punt | grep -s "$OCF_RESKEY_database_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` - rc_db=$? - if [ $rc_db -ne 0 ]; then - ocf_log err "Nova Scheduler is not connected to the database server: $rc_db" - return $OCF_NOT_RUNNING - fi - else + pid=`cat $OCF_RESKEY_pid` + scheduler_db_check=`netstat -punt | grep -s "$OCF_RESKEY_database_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` + rc_db=$? + if [ $rc_db -ne 0 ]; then + ocf_log err "Nova Scheduler is not connected to the database server: $rc_db" + return $OCF_NOT_RUNNING + fi + else pid=`cat $OCF_RESKEY_pid` scheduler_db_check=`netstat -punt | grep -s "$OCF_RESKEY_database_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` rc_db=$? scheduler_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` rc_amqp=$? - if [ $rc_amqp -ne 0 ] || [ $rc_db -ne 0 ]; then - ocf_log err "Nova Scheduler is not connected to the AMQP server and/or the database server: AMQP connection test returned $rc_amqp and database connection test returned $rc_db" - return $OCF_NOT_RUNNING - fi - fi + if [ $rc_amqp -ne 0 ] || [ $rc_db -ne 0 ]; then + ocf_log err "Nova Scheduler is not connected to the AMQP server and/or the database server: AMQP connection test returned $rc_amqp and database connection test returned $rc_db" + return $OCF_NOT_RUNNING + fi + fi ocf_log debug "OpenStack Nova Scheduler (nova-scheduler) monitor succeeded" return $OCF_SUCCESS