Browse code

clean up whitespace issues on exercises and friends

Change-Id: I812a73e46ddd4d5fed4d304d9ef92c1de243f497

Sean Dague authored on 2013/10/22 23:06:06
Showing 8 changed files
... ...
@@ -119,7 +119,7 @@ nova flavor-list
119 119
 INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
120 120
 if [[ -z "$INSTANCE_TYPE" ]]; then
121 121
     # grab the first flavor in the list to launch if default doesn't exist
122
-   INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
122
+    INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
123 123
 fi
124 124
 
125 125
 # Clean-up from previous runs
... ...
@@ -62,7 +62,7 @@ die_if_not_set $LINENO IMAGE "Failure getting image $DOCKER_IMAGE_NAME"
62 62
 INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
63 63
 if [[ -z "$INSTANCE_TYPE" ]]; then
64 64
     # grab the first flavor in the list to launch if default doesn't exist
65
-   INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
65
+    INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
66 66
 fi
67 67
 
68 68
 # Clean-up from previous runs
... ...
@@ -102,4 +102,3 @@ set +o xtrace
102 102
 echo "*********************************************************************"
103 103
 echo "SUCCESS: End DevStack Exercise: $0"
104 104
 echo "*********************************************************************"
105
-
... ...
@@ -87,31 +87,31 @@ fi
87 87
 # Volumes
88 88
 # -------
89 89
 if is_service_enabled c-vol && ! is_service_enabled n-cell; then
90
-   VOLUME_ZONE=`euca-describe-availability-zones | head -n1 | cut -f2`
91
-   die_if_not_set $LINENO VOLUME_ZONE "Failure to find zone for volume"
92
-
93
-   VOLUME=`euca-create-volume -s 1 -z $VOLUME_ZONE | cut -f2`
94
-   die_if_not_set $LINENO VOLUME "Failure to create volume"
95
-
96
-   # Test that volume has been created
97
-   VOLUME=`euca-describe-volumes $VOLUME | cut -f2`
98
-   die_if_not_set $LINENO VOLUME "Failure to get volume"
99
-
100
-   # Test volume has become available
101
-   if ! timeout $RUNNING_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -q available; do sleep 1; done"; then
102
-       die $LINENO "volume didn't become available within $RUNNING_TIMEOUT seconds"
103
-   fi
104
-
105
-   # Attach volume to an instance
106
-   euca-attach-volume -i $INSTANCE -d $ATTACH_DEVICE $VOLUME || \
107
-       die $LINENO "Failure attaching volume $VOLUME to $INSTANCE"
108
-   if ! timeout $ACTIVE_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -A 1 in-use | grep -q attach; do sleep 1; done"; then
109
-       die $LINENO "Could not attach $VOLUME to $INSTANCE"
110
-   fi
111
-
112
-   # Detach volume from an instance
113
-   euca-detach-volume $VOLUME || \
114
-       die $LINENO "Failure detaching volume $VOLUME to $INSTANCE"
90
+    VOLUME_ZONE=`euca-describe-availability-zones | head -n1 | cut -f2`
91
+    die_if_not_set $LINENO VOLUME_ZONE "Failure to find zone for volume"
92
+
93
+    VOLUME=`euca-create-volume -s 1 -z $VOLUME_ZONE | cut -f2`
94
+    die_if_not_set $LINENO VOLUME "Failure to create volume"
95
+
96
+    # Test that volume has been created
97
+    VOLUME=`euca-describe-volumes $VOLUME | cut -f2`
98
+    die_if_not_set $LINENO VOLUME "Failure to get volume"
99
+
100
+    # Test volume has become available
101
+    if ! timeout $RUNNING_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -q available; do sleep 1; done"; then
102
+        die $LINENO "volume didn't become available within $RUNNING_TIMEOUT seconds"
103
+    fi
104
+
105
+    # Attach volume to an instance
106
+    euca-attach-volume -i $INSTANCE -d $ATTACH_DEVICE $VOLUME || \
107
+        die $LINENO "Failure attaching volume $VOLUME to $INSTANCE"
108
+    if ! timeout $ACTIVE_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -A 1 in-use | grep -q attach; do sleep 1; done"; then
109
+        die $LINENO "Could not attach $VOLUME to $INSTANCE"
110
+    fi
111
+
112
+    # Detach volume from an instance
113
+    euca-detach-volume $VOLUME || \
114
+        die $LINENO "Failure detaching volume $VOLUME to $INSTANCE"
115 115
     if ! timeout $ACTIVE_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -q available; do sleep 1; done"; then
116 116
         die $LINENO "Could not detach $VOLUME to $INSTANCE"
117 117
     fi
... ...
@@ -120,7 +120,7 @@ if is_service_enabled c-vol && ! is_service_enabled n-cell; then
120 120
     euca-delete-volume $VOLUME || \
121 121
         die $LINENO "Failure to delete volume"
122 122
     if ! timeout $ACTIVE_TIMEOUT sh -c "while euca-describe-volumes | grep $VOLUME; do sleep 1; done"; then
123
-       die $LINENO "Could not delete $VOLUME"
123
+        die $LINENO "Could not delete $VOLUME"
124 124
     fi
125 125
 else
126 126
     echo "Volume Tests Skipped"
... ...
@@ -113,7 +113,7 @@ nova flavor-list
113 113
 INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
114 114
 if [[ -z "$INSTANCE_TYPE" ]]; then
115 115
     # grab the first flavor in the list to launch if default doesn't exist
116
-   INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
116
+    INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
117 117
 fi
118 118
 
119 119
 # Clean-up from previous runs
... ...
@@ -168,7 +168,7 @@ if ! is_service_enabled neutron; then
168 168
     # list floating addresses
169 169
     if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! nova floating-ip-list | grep $TEST_FLOATING_POOL | grep -q $TEST_FLOATING_IP; do sleep 1; done"; then
170 170
         die $LINENO "Floating IP not allocated"
171
-     fi
171
+    fi
172 172
 fi
173 173
 
174 174
 # Dis-allow icmp traffic (ping)
... ...
@@ -273,12 +273,12 @@ function create_vms {
273 273
 }
274 274
 
275 275
 function ping_ip {
276
-     # Test agent connection.  Assumes namespaces are disabled, and
277
-     # that DHCP is in use, but not L3
278
-     local VM_NAME=$1
279
-     local NET_NAME=$2
280
-     IP=$(get_instance_ip $VM_NAME $NET_NAME)
281
-     ping_check $NET_NAME $IP $BOOT_TIMEOUT
276
+    # Test agent connection.  Assumes namespaces are disabled, and
277
+    # that DHCP is in use, but not L3
278
+    local VM_NAME=$1
279
+    local NET_NAME=$2
280
+    IP=$(get_instance_ip $VM_NAME $NET_NAME)
281
+    ping_check $NET_NAME $IP $BOOT_TIMEOUT
282 282
 }
283 283
 
284 284
 function check_vm {
... ...
@@ -330,12 +330,12 @@ function delete_network {
330 330
 }
331 331
 
332 332
 function delete_networks {
333
-   foreach_tenant_net 'delete_network ${%TENANT%_NAME} %NUM%'
334
-   #TODO(nati) add secuirty group check after it is implemented
335
-   # source $TOP_DIR/openrc demo1 demo1
336
-   # nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
337
-   # source $TOP_DIR/openrc demo2 demo2
338
-   # nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
333
+    foreach_tenant_net 'delete_network ${%TENANT%_NAME} %NUM%'
334
+    # TODO(nati) add secuirty group check after it is implemented
335
+    # source $TOP_DIR/openrc demo1 demo1
336
+    # nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
337
+    # source $TOP_DIR/openrc demo2 demo2
338
+    # nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
339 339
 }
340 340
 
341 341
 function create_all {
... ...
@@ -117,7 +117,7 @@ nova flavor-list
117 117
 INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
118 118
 if [[ -z "$INSTANCE_TYPE" ]]; then
119 119
     # grab the first flavor in the list to launch if default doesn't exist
120
-   INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
120
+    INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
121 121
 fi
122 122
 
123 123
 # Clean-up from previous runs
... ...
@@ -66,12 +66,12 @@ fi
66 66
 # Heat
67 67
 if [[ "$ENABLED_SERVICES" =~ "heat" ]]; then
68 68
     HEAT_USER=$(get_id keystone user-create --name=heat \
69
-                                              --pass="$SERVICE_PASSWORD" \
70
-                                              --tenant_id $SERVICE_TENANT \
71
-                                              --email=heat@example.com)
69
+        --pass="$SERVICE_PASSWORD" \
70
+        --tenant_id $SERVICE_TENANT \
71
+        --email=heat@example.com)
72 72
     keystone user-role-add --tenant-id $SERVICE_TENANT \
73
-                           --user-id $HEAT_USER \
74
-                           --role-id $SERVICE_ROLE
73
+        --user-id $HEAT_USER \
74
+        --role-id $SERVICE_ROLE
75 75
     # heat_stack_user role is for users created by Heat
76 76
     keystone role-create --name heat_stack_user
77 77
     if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
... ...
@@ -126,16 +126,16 @@ fi
126 126
 # Ceilometer
127 127
 if [[ "$ENABLED_SERVICES" =~ "ceilometer" ]]; then
128 128
     CEILOMETER_USER=$(get_id keystone user-create --name=ceilometer \
129
-                                              --pass="$SERVICE_PASSWORD" \
130
-                                              --tenant_id $SERVICE_TENANT \
131
-                                              --email=ceilometer@example.com)
129
+        --pass="$SERVICE_PASSWORD" \
130
+        --tenant_id $SERVICE_TENANT \
131
+        --email=ceilometer@example.com)
132 132
     keystone user-role-add --tenant-id $SERVICE_TENANT \
133
-                           --user-id $CEILOMETER_USER \
134
-                           --role-id $ADMIN_ROLE
133
+        --user-id $CEILOMETER_USER \
134
+        --role-id $ADMIN_ROLE
135 135
     # Ceilometer needs ResellerAdmin role to access swift account stats.
136 136
     keystone user-role-add --tenant-id $SERVICE_TENANT \
137
-                           --user-id $CEILOMETER_USER \
138
-                           --role-id $RESELLER_ROLE
137
+        --user-id $CEILOMETER_USER \
138
+        --role-id $RESELLER_ROLE
139 139
     if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
140 140
         CEILOMETER_SERVICE=$(get_id keystone service-create \
141 141
             --name=ceilometer \
... ...
@@ -122,16 +122,16 @@ fi
122 122
 
123 123
 # test empty option
124 124
 if ini_has_option test.ini ddd empty; then
125
-   echo "OK: ddd.empty present"
125
+    echo "OK: ddd.empty present"
126 126
 else
127
-   echo "ini_has_option failed: ddd.empty not found"
127
+    echo "ini_has_option failed: ddd.empty not found"
128 128
 fi
129 129
 
130 130
 # test non-empty option
131 131
 if ini_has_option test.ini bbb handlers; then
132
-   echo "OK: bbb.handlers present"
132
+    echo "OK: bbb.handlers present"
133 133
 else
134
-   echo "ini_has_option failed: bbb.handlers not found"
134
+    echo "ini_has_option failed: bbb.handlers not found"
135 135
 fi
136 136
 
137 137
 # test changing empty option