From b31304829f4ec3830c30fcf25c55f100ebfe7227 Mon Sep 17 00:00:00 2001 From: Andrew Lazarev Date: Tue, 16 Dec 2014 14:36:59 -0800 Subject: [PATCH] Register heat image in sahara image registry for fake plugin Fake plugin can work with heat image. Even more, sahara uses heat to provision instances. So, registering image in sahara image registry. Change-Id: Ie498fc05d0afe7f276b6f29f20a61abb58a5c676 Closes-Bug: #1402856 --- extras.d/70-sahara.sh | 1 + lib/sahara | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/extras.d/70-sahara.sh b/extras.d/70-sahara.sh index 2a349991ef..f177766d3b 100644 --- a/extras.d/70-sahara.sh +++ b/extras.d/70-sahara.sh @@ -15,6 +15,7 @@ if is_service_enabled sahara; then create_sahara_accounts elif [[ "$1" == "stack" && "$2" == "extra" ]]; then echo_summary "Initializing sahara" + sahara_register_images start_sahara fi diff --git a/lib/sahara b/lib/sahara index c902d385d1..03b902e5b6 100644 --- a/lib/sahara +++ b/lib/sahara @@ -11,6 +11,7 @@ # install_sahara # install_python_saharaclient # configure_sahara +# sahara_register_images # start_sahara # stop_sahara # cleanup_sahara @@ -161,6 +162,17 @@ function install_python_saharaclient { fi } +# sahara_register_images() - Registers images in sahara image registry +function sahara_register_images { + if is_service_enabled heat && [[ ! -z "$HEAT_CFN_IMAGE_URL" ]]; then + # Register heat image for Fake plugin + local fake_plugin_properties="--property _sahara_tag_0.1=True" + fake_plugin_properties+=" --property _sahara_tag_fake=True" + fake_plugin_properties+=" --property _sahara_username=fedora" + openstack --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT image set $(basename "$HEAT_CFN_IMAGE_URL" ".qcow2") $fake_plugin_properties + fi +} + # start_sahara() - Start running processes, including screen function start_sahara { run_process sahara "$SAHARA_BIN_DIR/sahara-all --config-file $SAHARA_CONF_FILE"