Browse code

Check dib is available before building heat test image

When running with HEAT_CREATE_TEST_IMAGE=True, it's necessary
to add dib to ENABLED_SERVICES, or the image building will fail
so check for is_service_enabled dib before we start and error
with a helpful message if it's not.

Change-Id: Ia7ee64f6f8dd628267e485a1dc67581d8896d19c

Steven Hardy authored on 2015/01/14 19:52:03
Showing 1 changed files
... ...
@@ -10,6 +10,7 @@
10 10
 # Dependencies:
11 11
 #
12 12
 # - functions
13
+# - dib (if HEAT_CREATE_TEST_IMAGE=True)
13 14
 
14 15
 # stack.sh
15 16
 # ---------
... ...
@@ -290,19 +291,25 @@ function create_heat_accounts {
290 290
 
291 291
 # build_heat_functional_test_image() - Build and upload functional test image
292 292
 function build_heat_functional_test_image {
293
-    build_dib_pip_repo "$OCC_DIR $OAC_DIR $ORC_DIR $HEAT_CFNTOOLS_DIR"
294
-    local image_name=heat-functional-tests-image
295
-
296
-    # The elements to invoke disk-image-create with
297
-    local image_elements="vm fedora selinux-permissive pypi \
298
-        os-collect-config os-refresh-config os-apply-config heat-cfntools \
299
-        heat-config heat-config-cfn-init heat-config-puppet heat-config-script"
300
-
301
-    # Elements path for tripleo-image-elements and heat-templates software-config
302
-    local elements_path=$TIE_DIR/elements:$HEAT_TEMPLATES_REPO_DIR/hot/software-config/elements
303
-
304
-    disk_image_create_upload "$image_name" "$image_elements" "$elements_path"
305
-    iniset $TEMPEST_CONFIG orchestration image_ref $image_name
293
+    if is_service_enabled dib; then
294
+        build_dib_pip_repo "$OCC_DIR $OAC_DIR $ORC_DIR $HEAT_CFNTOOLS_DIR"
295
+        local image_name=heat-functional-tests-image
296
+
297
+        # The elements to invoke disk-image-create with
298
+        local image_elements="vm fedora selinux-permissive pypi \
299
+            os-collect-config os-refresh-config os-apply-config heat-cfntools \
300
+            heat-config heat-config-cfn-init heat-config-puppet heat-config-script"
301
+
302
+        # Elements path for tripleo-image-elements and heat-templates software-config
303
+        local elements_path=$TIE_DIR/elements:$HEAT_TEMPLATES_REPO_DIR/hot/software-config/elements
304
+
305
+        disk_image_create_upload "$image_name" "$image_elements" "$elements_path"
306
+        iniset $TEMPEST_CONFIG orchestration image_ref $image_name
307
+    else
308
+        echo "Error, HEAT_CREATE_TEST_IMAGE=True requires dib" >&2
309
+        echo "Add \"enable_service dib\" to your localrc" >&2
310
+        exit 1
311
+    fi
306 312
 }
307 313
 
308 314
 # Restore xtrace