From 1f3f4b0a69a70bb5fce0707a517d67c896c3cf2c Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Wed, 14 Jan 2015 10:52:03 +0000 Subject: [PATCH] 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 --- lib/heat | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/heat b/lib/heat index 9a28af568b..c9a3f7e6e2 100644 --- a/lib/heat +++ b/lib/heat @@ -10,6 +10,7 @@ # Dependencies: # # - functions +# - dib (if HEAT_CREATE_TEST_IMAGE=True) # stack.sh # --------- @@ -290,19 +291,25 @@ function create_heat_accounts { # build_heat_functional_test_image() - Build and upload functional test image function build_heat_functional_test_image { - build_dib_pip_repo "$OCC_DIR $OAC_DIR $ORC_DIR $HEAT_CFNTOOLS_DIR" - local image_name=heat-functional-tests-image + if is_service_enabled dib; then + build_dib_pip_repo "$OCC_DIR $OAC_DIR $ORC_DIR $HEAT_CFNTOOLS_DIR" + local image_name=heat-functional-tests-image - # The elements to invoke disk-image-create with - local image_elements="vm fedora selinux-permissive pypi \ - os-collect-config os-refresh-config os-apply-config heat-cfntools \ - heat-config heat-config-cfn-init heat-config-puppet heat-config-script" + # The elements to invoke disk-image-create with + local image_elements="vm fedora selinux-permissive pypi \ + os-collect-config os-refresh-config os-apply-config heat-cfntools \ + heat-config heat-config-cfn-init heat-config-puppet heat-config-script" - # Elements path for tripleo-image-elements and heat-templates software-config - local elements_path=$TIE_DIR/elements:$HEAT_TEMPLATES_REPO_DIR/hot/software-config/elements + # Elements path for tripleo-image-elements and heat-templates software-config + local elements_path=$TIE_DIR/elements:$HEAT_TEMPLATES_REPO_DIR/hot/software-config/elements - disk_image_create_upload "$image_name" "$image_elements" "$elements_path" - iniset $TEMPEST_CONFIG orchestration image_ref $image_name + disk_image_create_upload "$image_name" "$image_elements" "$elements_path" + iniset $TEMPEST_CONFIG orchestration image_ref $image_name + else + echo "Error, HEAT_CREATE_TEST_IMAGE=True requires dib" >&2 + echo "Add \"enable_service dib\" to your localrc" >&2 + exit 1 + fi } # Restore xtrace