]> review.fuel-infra Code Review - openstack-build/horizon-build.git/commitdiff
Get rid of django.utils.log.NullHandler class in local_settings.py
authorIvan Udovichenko <iudovichenko@mirantis.com>
Fri, 3 Jun 2016 12:20:03 +0000 (15:20 +0300)
committerIvan Udovichenko <iudovichenko@mirantis.com>
Fri, 3 Jun 2016 12:20:03 +0000 (15:20 +0300)
Rewritten-From: b70d5b870f4b838d059f8ed33b05e2a16544df02

trusty/debian/changelog
trusty/debian/openstack-dashboard.postinst

index 1b281a5f4013f0a4e46879e9492f7f59a637b0dd..a296ebe9067817e2558355680e4f02befd422b55 100644 (file)
@@ -1,4 +1,4 @@
-horizon (2:9.0.0-3) UNRELEASED; urgency=medium
+horizon (2:9.0.0-3) unstable; urgency=medium
 
   [ Ondřej Nový ]
   * d/copyright: Changed source URL to https protocol
@@ -7,6 +7,9 @@ horizon (2:9.0.0-3) UNRELEASED; urgency=medium
   * d/openstack-dashboard.{preinst,postinst,postrm},
       openstack-dashboard-apache.{preinst,postinst,postrm}:
       - Pass the correct version to dpkg-maintscript-helper script.
+  * d/openstack-dashboard.postinst:
+      - Check if django.utils.log.NullHandler class is being used and
+        replace it with logging.NullHandler class if it is true. (Closes: #822907)
 
   [ Thomas Goirand ]
   * Horizon doesn't build with python-django-nose in Jessie, so increasing the
index e6b4b82a7eec12961fd444d5caa7d7b5eae1c78a..7d064f5be2302e209104ad8977ecd7bda8afc630 100644 (file)
@@ -16,10 +16,13 @@ if [ "$1" = "configure" ] ; then
        chown www-data:www-data /var/lib/openstack-dashboard/secret-key
 
        mkdir -p /etc/openstack-dashboard
-       if ! [ -f /etc/openstack-dashboard/local_settings.py ] ; then
-               cp /usr/share/openstack-dashboard/local_settings.py /etc/openstack-dashboard/local_settings.py
+       DASHBOARD_LOCAL_SETTINGS='/etc/openstack-dashboard/local_settings.py'
+       if ! [ -f "$DASHBOARD_LOCAL_SETTINGS" ] ; then
+               cp /usr/share/openstack-dashboard/local_settings.py $DASHBOARD_LOCAL_SETTINGS
+       fi
+       if [ -f "$DASHBOARD_LOCAL_SETTINGS" ] && grep -q 'django.utils.log.NullHandler' $DASHBOARD_LOCAL_SETTINGS; then
+               sed -i 's/django.utils.log.NullHandler/logging.NullHandler/g' $DASHBOARD_LOCAL_SETTINGS
        fi
-
        if [ -L /usr/share/openstack-dashboard/static ]; then
                if ! [ $(readlink -s /usr/share/openstack-dashboard/static) = /var/lib/openstack-dashboard/static ]; then
                        ln -fs /var/lib/openstack-dashboard/static /usr/share/openstack-dashboard/static