From bccfe3f9f173f3fa5fb86914778e48d9923bc2ae Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Thu, 21 Oct 2010 12:51:12 -0500 Subject: web_reports: Moved location of reports.wsgi to a more stable location --- debian/bcfg2-web.install | 1 + debian/control | 1 + debian/rules | 5 ----- misc/apache/bcfg2.conf | 4 +--- misc/bcfg2.spec | 5 +++-- reports/reports.wsgi | 4 ++++ setup.py | 4 ++-- src/lib/Server/Reports/reports.wsgi | 4 ---- 8 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 reports/reports.wsgi delete mode 100644 src/lib/Server/Reports/reports.wsgi diff --git a/debian/bcfg2-web.install b/debian/bcfg2-web.install index bfa55a925..68caa98fa 100644 --- a/debian/bcfg2-web.install +++ b/debian/bcfg2-web.install @@ -1,2 +1,3 @@ misc/apache/bcfg2.conf etc/apache2/conf.d/ +debian/tmp/usr/share/bcfg2/reports.wsgi debian/tmp/usr/share/bcfg2/site_media/* diff --git a/debian/control b/debian/control index 726958c85..4db926f77 100644 --- a/debian/control +++ b/debian/control @@ -33,6 +33,7 @@ Description: Configuration management server Package: bcfg2-web Architecture: all Depends: ${python:Depends}, ${misc:Depends}, bcfg2 (= ${binary:Version}), python-django, libapache2-mod-wsgi +Suggests: python-mysqldb, python-psycopg2, python-sqlite XB-Python-Version: >= 2.4 Description: Configuration management web interface Bcfg2 is a configuration management system that generates configuration sets diff --git a/debian/rules b/debian/rules index 928880859..1638b8415 100755 --- a/debian/rules +++ b/debian/rules @@ -18,8 +18,3 @@ override_dh_installinit: # Install bcfg2-server initscript without starting it on postinst dh_installinit --package=bcfg2-server --no-start -override_dh_installdeb: - dh_installdeb - perl -pi -e 's/^.*LoadModule.*//' debian/bcfg2-web/etc/apache2/conf.d/bcfg2.conf - perl -pi -e 's|/usr.*/reports.wsgi|$(WSGI_LOC)|' debian/bcfg2-web/etc/apache2/conf.d/bcfg2.conf - diff --git a/misc/apache/bcfg2.conf b/misc/apache/bcfg2.conf index 2963091ec..b9b4b0452 100644 --- a/misc/apache/bcfg2.conf +++ b/misc/apache/bcfg2.conf @@ -1,10 +1,8 @@ -LoadModule wsgi_module modules/mod_wsgi.so - # # If the root is changed update the static content alias as well # - WSGIScriptAlias /bcfg2 "/usr/lib/python2.4/site-packages/Bcfg2/Server/Reports/reports.wsgi" + WSGIScriptAlias /bcfg2 "/usr/share/bcfg2/reports.wsgi" WSGISocketPrefix run WSGIDaemonProcess Bcfg2.Server.Reports processes=1 threads=10 diff --git a/misc/bcfg2.spec b/misc/bcfg2.spec index e9798c39f..8e77ad908 100644 --- a/misc/bcfg2.spec +++ b/misc/bcfg2.spec @@ -158,7 +158,7 @@ deployment strategies. %{__install} -m 755 tools/bcfg2-cron %{buildroot}%{_prefix}/lib/bcfg2/bcfg2-cron %{__install} -d %{buildroot}%{apache_conf}/conf.d -%{__install} -m 644 misc/apache/bcfg2.conf %{buildroot}%{apache_conf}/conf.d/bcfg2.conf +%{__install} -m 644 misc/apache/bcfg2.conf %{buildroot}%{apache_conf}/conf.d/wsgi_bcfg2.conf %clean [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot} || exit 2 @@ -209,9 +209,10 @@ deployment strategies. %files -n bcfg2-web %defattr(-,root,root,-) +%{_datadir}/bcfg2/reports.wsgi %{_datadir}/bcfg2/site_media -%config(noreplace) %{apache_conf}/conf.d/bcfg2.conf +%config(noreplace) %{apache_conf}/conf.d/wsgi_bcfg2.conf %changelog * Mon Jun 21 2010 Fabian Affolter - 1.1.0rc3-0.1 diff --git a/reports/reports.wsgi b/reports/reports.wsgi new file mode 100644 index 000000000..232650485 --- /dev/null +++ b/reports/reports.wsgi @@ -0,0 +1,4 @@ +import os +os.environ['DJANGO_SETTINGS_MODULE'] = 'Bcfg2.Server.Reports.settings' +import django.core.handlers.wsgi +application = django.core.handlers.wsgi.WSGIHandler() diff --git a/setup.py b/setup.py index 6d5aae417..37a6b9e36 100644 --- a/setup.py +++ b/setup.py @@ -30,8 +30,7 @@ setup(cmdclass=cmdclass, package_dir = {'Bcfg2':'src/lib'}, package_data = {'Bcfg2.Server.Reports.reports':['fixtures/*.xml', 'templates/*.html', 'templates/*/*.html', - 'templates/*/*.inc' ], - 'Bcfg2.Server.Reports':['reports.wsgi'] }, + 'templates/*/*.inc' ] }, scripts = glob('src/sbin/*'), data_files = [('share/bcfg2/schemas', glob('schemas/*.xsd')), @@ -39,6 +38,7 @@ setup(cmdclass=cmdclass, glob('reports/xsl-transforms/*.xsl')), ('share/bcfg2/xsl-transforms/xsl-transform-includes', glob('reports/xsl-transforms/xsl-transform-includes/*.xsl')), + ('share/bcfg2', ['reports/reports.wsgi']), ('share/man/man1', glob("man/bcfg2.1")), ('share/man/man5', glob("man/*.5")), ('share/man/man8', glob("man/*.8")), diff --git a/src/lib/Server/Reports/reports.wsgi b/src/lib/Server/Reports/reports.wsgi deleted file mode 100644 index 232650485..000000000 --- a/src/lib/Server/Reports/reports.wsgi +++ /dev/null @@ -1,4 +0,0 @@ -import os -os.environ['DJANGO_SETTINGS_MODULE'] = 'Bcfg2.Server.Reports.settings' -import django.core.handlers.wsgi -application = django.core.handlers.wsgi.WSGIHandler() -- cgit v1.2.3-1-g7c22