#!/bin/bash

set -eux

# Seen some transient issues with older django14 where the compress step fails
# on the django import.
yum -y erase python-django14 || true

yum -y install openstack-dashboard python-django-horizon

pushd /usr/share/openstack-dashboard
python manage.py compress --force
popd

sed -i 's/^ALLOWED_HOSTS.*/ALLOWED_HOSTS = ["*"]/' /etc/openstack-dashboard/local_settings 

systemctl restart httpd
