From: Ivan Suzdal Date: Thu, 19 May 2016 16:15:39 +0000 (+0300) Subject: Set ALLOWED_HOSTS variable for cobbler-web settings. X-Git-Tag: mos-9.0~1 X-Git-Url: https://review.fuel-infra.org/gitweb?p=packages%2Fcentos7%2Fcobbler.git;a=commitdiff_plain;h=234bb8912faacdc1840d00e67caf8833d12ab502 Set ALLOWED_HOSTS variable for cobbler-web settings. Since django version 1.5 (IIUC) if your host is not in ALLOWED_HOSTS - you will get http error 400 from django application (surprisingly, yeah?). So, simplest way to resolve this issue - add all hosts to ALLOWED_HOSTS. Change-Id: I0705b4e008e67d95e9ea2dab903babecd03c9715 Closes-Bug: #1583648 (cherry picked from commit 735d83c81a39c1d07edc31fc8843d575a587ffc7) --- diff --git a/Mirantis-Add-ALLOWED_HOSTS-for-settings.patch b/Mirantis-Add-ALLOWED_HOSTS-for-settings.patch new file mode 100644 index 0000000..5068f51 --- /dev/null +++ b/Mirantis-Add-ALLOWED_HOSTS-for-settings.patch @@ -0,0 +1,14 @@ +Index: cobbler-2.6.11/web/settings.py +=================================================================== +--- cobbler-2.6.11.orig/web/settings.py ++++ cobbler-2.6.11/web/settings.py +@@ -4,6 +4,9 @@ import django + DEBUG = True + TEMPLATE_DEBUG = DEBUG + ++# Allow connect to django from any hosts ++ALLOWED_HOSTS = '*' ++ + ADMINS = ( + # ('Your Name', 'your_email@domain.com'), + ) diff --git a/cobbler.spec b/cobbler.spec index 9df8359..63676e3 100644 --- a/cobbler.spec +++ b/cobbler.spec @@ -16,7 +16,7 @@ Name: cobbler License: GPLv2+ AutoReq: no Version: 2.6.9 -Release: 1%{?dist}~mos9 +Release: 1%{?dist}~mos10 Source0: https://github.com/cobbler/cobbler/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz # Support newer virt-install - https://bugzilla.redhat.com/show_bug.cgi?id=1188424 Patch0: cobbler-virtinstall.patch @@ -26,6 +26,9 @@ Patch1: cobbler-centos.patch # Support django1.7+ # https://github.com/cobbler/cobbler-web/issues/9 Patch2: cobbler-django17.patch +# Add ALLOWED_HOSTS into djando settings +Patch3: Mirantis-Add-ALLOWED_HOSTS-for-settings.patch + Group: Applications/System BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildArch: noarch @@ -89,6 +92,7 @@ other applications. # django 1.8 on Fedora 22+ %if 0%{?fedora} >= 22 || 0%{?rhel} >= 6 %patch2 -p1 -b .django17 +%patch3 -p1 %endif %build @@ -284,6 +288,10 @@ sed -i -e "s/SECRET_KEY = ''/SECRET_KEY = \'$RAND_SECRET\'/" /usr/share/cobbler/ %changelog +* Thu May 19 2016 Ivan Suzdal - 2.6.9-1~mos10 +- Add patch to fix 'error 400' for cobbler-web (LP: #1583648) +- Bump version + * Thu Feb 11 2016 Ivan Suzdal - 2.6.9-1~mos9 - Add 'rhel' condition for django17 path - Bump version