introduce if/then & for/do rules

we mostly have a consistent style on if/then & for/do in devstack,
except when we don't. This attempts to build a set of rules to
enforce this.

Because there are times when lines are legitimately long, and there
is a continuation, this starts off ignoring if and for loops with
continuations. But for short versions, we should enforce this.

Changes to make devstack pass are included. The fact that the
cleanup patch was so small is pretty solid reason that this is
actually the style we've all agreed to.

Part of a git stash from hong kong that I finally cleaned up.

Change-Id: I6376d7afd59cc5ebba9ed69e5ee784a3d5934a10
diff --git a/lib/baremetal b/lib/baremetal
index a0df85e..d8cd7e9 100644
--- a/lib/baremetal
+++ b/lib/baremetal
@@ -431,8 +431,7 @@
 
 function clear_baremetal_of_all_nodes() {
     list=$(nova baremetal-node-list | awk -F '| ' 'NR>3 {print $2}' )
-    for node in $list
-    do
+    for node in $list; do
         nova baremetal-node-delete $node
     done
 }
diff --git a/lib/heat b/lib/heat
index f171cb4..9f5dd8b 100644
--- a/lib/heat
+++ b/lib/heat
@@ -186,8 +186,7 @@
     local elements=$2
     local arch=$3
     local output=$TOP_DIR/files/$4
-    if [[ -f "$output.qcow2" ]];
-    then
+    if [[ -f "$output.qcow2" ]]; then
         echo "Image file already exists: $output_file"
     else
         ELEMENTS_PATH=$elements_path disk-image-create \
diff --git a/lib/neutron_plugins/bigswitch_floodlight b/lib/neutron_plugins/bigswitch_floodlight
index 93ec497..1e4aa00 100644
--- a/lib/neutron_plugins/bigswitch_floodlight
+++ b/lib/neutron_plugins/bigswitch_floodlight
@@ -44,16 +44,14 @@
 function neutron_plugin_configure_service() {
     iniset /$Q_PLUGIN_CONF_FILE restproxy servers $BS_FL_CONTROLLERS_PORT
     iniset /$Q_PLUGIN_CONF_FILE restproxy servertimeout $BS_FL_CONTROLLER_TIMEOUT
-    if [ "$BS_FL_VIF_DRIVER" = "ivs" ]
-    then
+    if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then
         iniset /$Q_PLUGIN_CONF_FILE nova vif_type ivs
     fi
 }
 
 function neutron_plugin_setup_interface_driver() {
     local conf_file=$1
-    if [ "$BS_FL_VIF_DRIVER" = "ivs" ]
-    then
+    if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then
         iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.IVSInterfaceDriver
     else
         iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
diff --git a/lib/neutron_plugins/nec b/lib/neutron_plugins/nec
index d8d8b7c..1cb2fef 100644
--- a/lib/neutron_plugins/nec
+++ b/lib/neutron_plugins/nec
@@ -106,8 +106,7 @@
     local id=0
     GRE_LOCAL_IP=${GRE_LOCAL_IP:-$HOST_IP}
     if [ -n "$GRE_REMOTE_IPS" ]; then
-        for ip in ${GRE_REMOTE_IPS//:/ }
-        do
+        for ip in ${GRE_REMOTE_IPS//:/ }; do
             if [[ "$ip" == "$GRE_LOCAL_IP" ]]; then
                 continue
             fi
diff --git a/lib/neutron_thirdparty/bigswitch_floodlight b/lib/neutron_thirdparty/bigswitch_floodlight
index 1fd4fd8..24c1044 100644
--- a/lib/neutron_thirdparty/bigswitch_floodlight
+++ b/lib/neutron_thirdparty/bigswitch_floodlight
@@ -24,8 +24,7 @@
     sudo ovs-vsctl --no-wait br-set-external-id ${OVS_BRIDGE} bridge-id ${OVS_BRIDGE}
 
     ctrls=
-    for ctrl in `echo ${BS_FL_CONTROLLERS_PORT} | tr ',' ' '`
-    do
+    for ctrl in `echo ${BS_FL_CONTROLLERS_PORT} | tr ',' ' '`; do
         ctrl=${ctrl%:*}
         ctrls="${ctrls} tcp:${ctrl}:${BS_FL_OF_PORT}"
     done