Skip to content

Commit 9ad6332

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Rework horizon image to support local_settings.d"
2 parents 410fafa + fde9264 commit 9ad6332

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docker/horizon/Dockerfile.j2

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,22 @@ ADD plugins-archive /
4646
COPY extend_start.sh /usr/local/bin/kolla_extend_start
4747

4848
# NOTE(hrw): to install horizon from unpacked sources we cannot have it in upper-constraints.txt
49+
# NOTE(kevko): This dance with local settings python paths below is needed
50+
# because we are using different distros with different python version and we need to
51+
# know to which path symlink should point to.
4952
RUN ln -s horizon-source/* horizon \
5053
&& {{ macros.upper_constraints_remove("horizon") }} \
5154
&& {{ macros.install_pip(horizon_pip_packages | customizable("pip_packages")) }} \
5255
&& mkdir -p /etc/openstack-dashboard \
5356
&& cp -r /horizon/openstack_dashboard/conf/* /etc/openstack-dashboard/ \
54-
&& cp /horizon/openstack_dashboard/local/local_settings.py.example /etc/openstack-dashboard/local_settings \
57+
&& cp /horizon/openstack_dashboard/local/local_settings.py.example /etc/openstack-dashboard/local_settings.py \
58+
&& local_settings=$(python -c 'import os;import openstack_dashboard;settings=os.path.dirname(openstack_dashboard.__file__) + "/local/local_settings.py";print(settings);') \
59+
&& rm -f $local_settings \
60+
&& ln -s /etc/openstack-dashboard/local_settings.py $local_settings \
61+
&& mkdir -p /etc/openstack-dashboard/local_settings.d \
62+
&& local_settings_d=$(python -c 'import os;import openstack_dashboard;settings_d=os.path.dirname(openstack_dashboard.__file__) + "/local/local_settings.d";print(settings_d);') \
63+
&& rm -rf $local_settings_d \
64+
&& ln -s /etc/openstack-dashboard/local_settings.d $local_settings_d \
5565
&& cp /horizon/manage.py /var/lib/kolla/venv/bin/manage.py \
5666
&& if [ "$(ls /plugins)" ]; then \
5767
{{ macros.install_pip(horizon_plugins_pip_packages) }}; \

0 commit comments

Comments
 (0)