#!/bin/bash
#
# Copyright (c) 2015 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#TODO(slukjanov): replace with special image for fake plugin (cloud ubuntu?)
if [ $PLUGIN == fake ] ; then
    export SAHARA_IMAGE=https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img
    export SAHARA_IMAGE_NAME=$(basename $SAHARA_IMAGE .img)
    export SAHARA_IMAGE_USERNAME=ubuntu
    export SAHARA_PLUGIN_NAME=fake
    export SAHARA_PLUGIN_VERSION=0.1
    export SAHARA_SCENARIO_TEMPLATE=fake.yaml.mako
    export SAHARA_FLAVOR_NAME=sahara-flavor
    export SAHARA_FLAVOR_ID=20
    export SAHARA_FLAVOR_RAM=512
    export SAHARA_FLAVOR_DISK=10
    export SAHARA_FLAVOR_VCPUS=1
else
    export SAHARA_IMAGE=file://$SAHARA_IMAGE_ELEMENTS_DIR/ubuntu_sahara_spark_latest.qcow2
    export SAHARA_IMAGE_NAME=$(basename $SAHARA_IMAGE .qcow2)
    export SAHARA_IMAGE_USERNAME=ubuntu
    export SAHARA_PLUGIN_NAME=spark
    export SAHARA_PLUGIN_VERSION=1.6.0
    export SAHARA_SCENARIO_TEMPLATE=spark-1.6.0.yaml.mako
    export SAHARA_FLAVOR_NAME=sahara-flavor
    export SAHARA_FLAVOR_ID=20
    export SAHARA_FLAVOR_RAM=1536
    export SAHARA_FLAVOR_DISK=20
    export SAHARA_FLAVOR_VCPUS=1
fi
