Browse code

Merge "make ceilometer work if you don't enable ceilometer-api"

Jenkins authored on 2014/03/02 02:20:31
Showing 1 changed files
... ...
@@ -206,9 +206,12 @@ function start_ceilometer {
206 206
     screen_it ceilometer-collector "cd ; ceilometer-collector --config-file $CEILOMETER_CONF"
207 207
     screen_it ceilometer-api "cd ; ceilometer-api -d -v --log-dir=$CEILOMETER_API_LOG_DIR --config-file $CEILOMETER_CONF"
208 208
 
209
-    echo "Waiting for ceilometer-api to start..."
210
-    if ! timeout $SERVICE_TIMEOUT sh -c "while ! curl --noproxy '*' -s http://localhost:8777/v2/ >/dev/null; do sleep 1; done"; then
211
-        die $LINENO "ceilometer-api did not start"
209
+    # only die on API if it was actually intended to be turned on
210
+    if service_enabled ceilometer-api; then
211
+        echo "Waiting for ceilometer-api to start..."
212
+        if ! timeout $SERVICE_TIMEOUT sh -c "while ! curl --noproxy '*' -s http://localhost:8777/v2/ >/dev/null; do sleep 1; done"; then
213
+            die $LINENO "ceilometer-api did not start"
214
+        fi
212 215
     fi
213 216
 
214 217
     screen_it ceilometer-alarm-notifier "cd ; ceilometer-alarm-notifier --config-file $CEILOMETER_CONF"