Move horizon config and start to appropriate phase in stack.sh
Previously horizon configuration and start are done too early and as a result horizon init and start need to be run twice after horizon plugins are enabled. - horizon config was done before "run_phase stack install" - horizon init and start were done before "run_phase stack post-config" This commit rearrange horizon setup to the appropriate phases defined in the devstack plugin interface. - Configuration of horizon settings is moved to configure_horizon. - horizon config is now called between run_phase stack install and post-config. - horizon init and start are now called between run_phase stack post-config and extra. Change-Id: I8bf2ceaf7734c4f7cec68bc05d7cdbae81ef311e
This commit is contained in:
parent
c81fb98814
commit
43f62c0849
@ -83,10 +83,7 @@ function configure_horizon {
|
|||||||
# Message catalog compilation is handled by Django admin script,
|
# Message catalog compilation is handled by Django admin script,
|
||||||
# so compiling them after the installation avoids Django installation twice.
|
# so compiling them after the installation avoids Django installation twice.
|
||||||
(cd $HORIZON_DIR; ./run_tests.sh -N --compilemessages)
|
(cd $HORIZON_DIR; ./run_tests.sh -N --compilemessages)
|
||||||
}
|
|
||||||
|
|
||||||
# init_horizon() - Initialize databases, etc.
|
|
||||||
function init_horizon {
|
|
||||||
# ``local_settings.py`` is used to override horizon default settings.
|
# ``local_settings.py`` is used to override horizon default settings.
|
||||||
local local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py
|
local local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py
|
||||||
cp $HORIZON_SETTINGS $local_settings
|
cp $HORIZON_SETTINGS $local_settings
|
||||||
@ -113,6 +110,7 @@ function init_horizon {
|
|||||||
horizon_conf=$(apache_site_config_for horizon)
|
horizon_conf=$(apache_site_config_for horizon)
|
||||||
|
|
||||||
# Configure apache to run horizon
|
# Configure apache to run horizon
|
||||||
|
# Set up the django horizon application to serve via apache/wsgi
|
||||||
sudo sh -c "sed -e \"
|
sudo sh -c "sed -e \"
|
||||||
s,%USER%,$APACHE_USER,g;
|
s,%USER%,$APACHE_USER,g;
|
||||||
s,%GROUP%,$APACHE_GROUP,g;
|
s,%GROUP%,$APACHE_GROUP,g;
|
||||||
@ -133,7 +131,10 @@ function init_horizon {
|
|||||||
exit_distro_not_supported "horizon apache configuration"
|
exit_distro_not_supported "horizon apache configuration"
|
||||||
fi
|
fi
|
||||||
enable_apache_site horizon
|
enable_apache_site horizon
|
||||||
|
}
|
||||||
|
|
||||||
|
# init_horizon() - Initialize databases, etc.
|
||||||
|
function init_horizon {
|
||||||
# Remove old log files that could mess with how DevStack detects whether Horizon
|
# Remove old log files that could mess with how DevStack detects whether Horizon
|
||||||
# has been successfully started (see start_horizon() and functions::screen_it())
|
# has been successfully started (see start_horizon() and functions::screen_it())
|
||||||
# and run_process
|
# and run_process
|
||||||
@ -147,6 +148,7 @@ function init_horizon {
|
|||||||
django_admin=django-admin.py
|
django_admin=django-admin.py
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# These need to be run after horizon plugins are configured.
|
||||||
DJANGO_SETTINGS_MODULE=openstack_dashboard.settings $django_admin collectstatic --noinput
|
DJANGO_SETTINGS_MODULE=openstack_dashboard.settings $django_admin collectstatic --noinput
|
||||||
DJANGO_SETTINGS_MODULE=openstack_dashboard.settings $django_admin compress --force
|
DJANGO_SETTINGS_MODULE=openstack_dashboard.settings $django_admin compress --force
|
||||||
|
|
||||||
|
14
stack.sh
14
stack.sh
@ -840,7 +840,6 @@ if is_service_enabled horizon; then
|
|||||||
install_django_openstack_auth
|
install_django_openstack_auth
|
||||||
# dashboard
|
# dashboard
|
||||||
stack_install_service horizon
|
stack_install_service horizon
|
||||||
configure_horizon
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if is_service_enabled heat; then
|
if is_service_enabled heat; then
|
||||||
@ -1060,12 +1059,9 @@ write_clouds_yaml
|
|||||||
# Horizon
|
# Horizon
|
||||||
# -------
|
# -------
|
||||||
|
|
||||||
# Set up the django horizon application to serve via apache/wsgi
|
|
||||||
|
|
||||||
if is_service_enabled horizon; then
|
if is_service_enabled horizon; then
|
||||||
echo_summary "Configuring and starting Horizon"
|
echo_summary "Configuring Horizon"
|
||||||
init_horizon
|
configure_horizon
|
||||||
start_horizon
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -1290,6 +1286,12 @@ if is_service_enabled heat; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled horizon; then
|
||||||
|
echo_summary "Starting Horizon"
|
||||||
|
init_horizon
|
||||||
|
start_horizon
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Create account rc files
|
# Create account rc files
|
||||||
# =======================
|
# =======================
|
||||||
|
Loading…
Reference in New Issue
Block a user