Deal with different django-admin executables
After the recent patch [1] the devstack is broken for Fedora 20 with
the error "django-admin.py: command not found" during horizon setup.
This is due to differences in how django currently packaged for Fedora,
where we should use "django-admin", without the .py
This patch sets up executable alias by checking if "django-admin"
exists, and falling back on "django-admin.py".
[1] https://review.openstack.org/#/c/120940/
Change-Id: I2b6de25fe32446edbdc0418674fea8579ec739d9
diff --git a/lib/horizon b/lib/horizon
index 872e77a..9fd1b85 100644
--- a/lib/horizon
+++ b/lib/horizon
@@ -142,8 +142,16 @@
# and run_process
sudo rm -f /var/log/$APACHE_NAME/horizon_*
- DJANGO_SETTINGS_MODULE=openstack_dashboard.settings django-admin.py collectstatic --noinput
- DJANGO_SETTINGS_MODULE=openstack_dashboard.settings django-admin.py compress --force
+ # Setup alias for django-admin which could be different depending on distro
+ local django_admin
+ if type -p django-admin > /dev/null; then
+ django_admin=django-admin
+ else
+ django_admin=django-admin.py
+ fi
+
+ DJANGO_SETTINGS_MODULE=openstack_dashboard.settings $django_admin collectstatic --noinput
+ DJANGO_SETTINGS_MODULE=openstack_dashboard.settings $django_admin compress --force
}