Browse code

Merge "Move horizon config and start to appropriate phase in stack.sh"

Jenkins authored on 2016/01/09 00:56:05
Showing 2 changed files
... ...
@@ -83,10 +83,7 @@ function configure_horizon {
83 83
     # Message catalog compilation is handled by Django admin script,
84 84
     # so compiling them after the installation avoids Django installation twice.
85 85
     (cd $HORIZON_DIR; ./run_tests.sh -N --compilemessages)
86
-}
87 86
 
88
-# init_horizon() - Initialize databases, etc.
89
-function init_horizon {
90 87
     # ``local_settings.py`` is used to override horizon default settings.
91 88
     local local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py
92 89
     cp $HORIZON_SETTINGS $local_settings
... ...
@@ -113,6 +110,7 @@ function init_horizon {
113 113
     horizon_conf=$(apache_site_config_for horizon)
114 114
 
115 115
     # Configure apache to run horizon
116
+    # Set up the django horizon application to serve via apache/wsgi
116 117
     sudo sh -c "sed -e \"
117 118
         s,%USER%,$APACHE_USER,g;
118 119
         s,%GROUP%,$APACHE_GROUP,g;
... ...
@@ -133,7 +131,10 @@ function init_horizon {
133 133
         exit_distro_not_supported "horizon apache configuration"
134 134
     fi
135 135
     enable_apache_site horizon
136
+}
136 137
 
138
+# init_horizon() - Initialize databases, etc.
139
+function init_horizon {
137 140
     # Remove old log files that could mess with how DevStack detects whether Horizon
138 141
     # has been successfully started (see start_horizon() and functions::screen_it())
139 142
     # and run_process
... ...
@@ -147,6 +148,7 @@ function init_horizon {
147 147
         django_admin=django-admin.py
148 148
     fi
149 149
 
150
+    # These need to be run after horizon plugins are configured.
150 151
     DJANGO_SETTINGS_MODULE=openstack_dashboard.settings $django_admin collectstatic --noinput
151 152
     DJANGO_SETTINGS_MODULE=openstack_dashboard.settings $django_admin compress --force
152 153
 
... ...
@@ -838,7 +838,6 @@ if is_service_enabled horizon; then
838 838
     install_django_openstack_auth
839 839
     # dashboard
840 840
     stack_install_service horizon
841
-    configure_horizon
842 841
 fi
843 842
 
844 843
 if is_service_enabled heat; then
... ...
@@ -1058,12 +1057,9 @@ write_clouds_yaml
1058 1058
 # Horizon
1059 1059
 # -------
1060 1060
 
1061
-# Set up the django horizon application to serve via apache/wsgi
1062
-
1063 1061
 if is_service_enabled horizon; then
1064
-    echo_summary "Configuring and starting Horizon"
1065
-    init_horizon
1066
-    start_horizon
1062
+    echo_summary "Configuring Horizon"
1063
+    configure_horizon
1067 1064
 fi
1068 1065
 
1069 1066
 
... ...
@@ -1288,6 +1284,12 @@ if is_service_enabled heat; then
1288 1288
     fi
1289 1289
 fi
1290 1290
 
1291
+if is_service_enabled horizon; then
1292
+    echo_summary "Starting Horizon"
1293
+    init_horizon
1294
+    start_horizon
1295
+fi
1296
+
1291 1297
 
1292 1298
 # Create account rc files
1293 1299
 # =======================