7ff8443e46
There are several backward compatibility nits. Change-Id: I93cac543375896602d158860cc557f86e41bcb63
73 lines
2.0 KiB
Plaintext
73 lines
2.0 KiB
Plaintext
# lib/sahara-dashboard
|
|
|
|
# Dependencies:
|
|
#
|
|
# - ``functions`` file
|
|
# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined
|
|
# - ``SERVICE_HOST``
|
|
|
|
# ``stack.sh`` calls the entry points in this order:
|
|
#
|
|
# - install_sahara_dashboard
|
|
# - configure_sahara_dashboard
|
|
# - cleanup_sahara_dashboard
|
|
|
|
# Save trace setting
|
|
XTRACE=$(set +o | grep xtrace)
|
|
set +o xtrace
|
|
|
|
source $TOP_DIR/lib/horizon
|
|
|
|
# Defaults
|
|
# --------
|
|
|
|
# Set up default repos
|
|
SAHARA_DASHBOARD_REPO=${SAHARA_DASHBOARD_REPO:-${GIT_BASE}/openstack/sahara-dashboard.git}
|
|
SAHARA_DASHBOARD_BRANCH=${SAHARA_DASHBOARD_BRANCH:-master}
|
|
|
|
SAHARA_PYTHONCLIENT_REPO=${SAHARA_PYTHONCLIENT_REPO:-${GIT_BASE}/openstack/python-saharaclient.git}
|
|
SAHARA_PYTHONCLIENT_BRANCH=${SAHARA_PYTHONCLIENT_BRANCH:-master}
|
|
|
|
# Set up default directories
|
|
SAHARA_DASHBOARD_DIR=$DEST/sahara-dashboard
|
|
SAHARA_PYTHONCLIENT_DIR=$DEST/python-saharaclient
|
|
|
|
# Functions
|
|
# ---------
|
|
|
|
function configure_sahara_dashboard {
|
|
|
|
echo -e "AUTO_ASSIGNMENT_ENABLED = False" >> $HORIZON_DIR/openstack_dashboard/local/local_settings.py
|
|
echo -e "HORIZON_CONFIG['dashboards'] += ('sahara',)" >> $HORIZON_DIR/openstack_dashboard/settings.py
|
|
echo -e "INSTALLED_APPS += ('saharadashboard',)" >> $HORIZON_DIR/openstack_dashboard/settings.py
|
|
|
|
if is_service_enabled neutron; then
|
|
echo -e "SAHARA_USE_NEUTRON = True" >> $HORIZON_DIR/openstack_dashboard/local/local_settings.py
|
|
fi
|
|
}
|
|
|
|
# install_sahara_dashboard() - Collect source and prepare
|
|
function install_sahara_dashboard {
|
|
install_python_saharaclient
|
|
git_clone $SAHARA_DASHBOARD_REPO $SAHARA_DASHBOARD_DIR $SAHARA_DASHBOARD_BRANCH
|
|
setup_develop $SAHARA_DASHBOARD_DIR
|
|
}
|
|
|
|
function install_python_saharaclient {
|
|
git_clone $SAHARA_PYTHONCLIENT_REPO $SAHARA_PYTHONCLIENT_DIR $SAHARA_PYTHONCLIENT_BRANCH
|
|
setup_develop $SAHARA_PYTHONCLIENT_DIR
|
|
}
|
|
|
|
# Cleanup file settings.py from Sahara
|
|
function cleanup_sahara_dashboard {
|
|
sed -i '/sahara/d' $HORIZON_DIR/openstack_dashboard/settings.py
|
|
}
|
|
|
|
# Restore xtrace
|
|
$XTRACE
|
|
|
|
# Local variables:
|
|
# mode: shell-script
|
|
# End:
|
|
|