From ae3930d0ccd491747622f0d5a5a1be7ec11b0251 Mon Sep 17 00:00:00 2001 From: Thomas Goirand <thomas@goirand.fr> Date: Mon, 11 Jan 2016 13:51:18 +0000 Subject: [PATCH] Added removed-redefinition-of-get_traceback_frame_variables.patch. Rewritten-From: 0a1485933638433eff2291512d6f7a6d0dc3b0d6 --- trusty/debian/changelog | 1 + ...ion-of-get_traceback_frame_variables.patch | 67 +++++++++++++++++++ trusty/debian/patches/series | 1 + 3 files changed, 69 insertions(+) create mode 100644 trusty/debian/patches/0150-removed-redefinition-of-get_traceback_frame_variables.patch diff --git a/trusty/debian/changelog b/trusty/debian/changelog index c06da75..3a86531 100644 --- a/trusty/debian/changelog +++ b/trusty/debian/changelog @@ -11,6 +11,7 @@ horizon (2:8.0.0-4) unstable; urgency=medium * Added fix-request.REQUEST-does-not-exist.patch. * Added remove-load-url-from-future.patch. * Added fix-assertRedirects-no-longer-forced-absolute-URLs.patch. + * Added removed-redefinition-of-get_traceback_frame_variables.patch. -- Thomas Goirand <zigo@debian.org> Mon, 11 Jan 2016 02:54:28 +0000 diff --git a/trusty/debian/patches/0150-removed-redefinition-of-get_traceback_frame_variables.patch b/trusty/debian/patches/0150-removed-redefinition-of-get_traceback_frame_variables.patch new file mode 100644 index 0000000..ccda299 --- /dev/null +++ b/trusty/debian/patches/0150-removed-redefinition-of-get_traceback_frame_variables.patch @@ -0,0 +1,67 @@ +Description: Removed redefinition of get_traceback_frame_variables + This code was part of fixes before Django 1.4 was released, and is no longer + necessary. In fact, it uses get_request_repr() which is not available in + Django 1.9 anymore, so it is necessary to remove it to avoid crashes. +Author: Thomas Goirand <zigo@debian.org> +Forwarded: no +Last-Update: 2016-01-11 + +--- horizon-8.0.0.orig/horizon/exceptions.py ++++ horizon-8.0.0/horizon/exceptions.py +@@ -40,56 +40,6 @@ class HorizonReporterFilter(SafeExceptio + def is_active(self, request): + return True + +- # TODO(gabriel): This bugfix is cribbed from Django's code. When 1.4.1 +- # is available we can remove this code. +- def get_traceback_frame_variables(self, request, tb_frame): +- """Replaces the values of variables marked as sensitive with +- stars (*********). +- """ +- # Loop through the frame's callers to see if the sensitive_variables +- # decorator was used. +- current_frame = tb_frame.f_back +- sensitive_variables = None +- while current_frame is not None: +- if (current_frame.f_code.co_name == 'sensitive_variables_wrapper' +- and 'sensitive_variables_wrapper' +- in current_frame.f_locals): +- # The sensitive_variables decorator was used, so we take note +- # of the sensitive variables' names. +- wrapper = current_frame.f_locals['sensitive_variables_wrapper'] +- sensitive_variables = getattr(wrapper, +- 'sensitive_variables', +- None) +- break +- current_frame = current_frame.f_back +- +- cleansed = [] +- if self.is_active(request) and sensitive_variables: +- if sensitive_variables == '__ALL__': +- # Cleanse all variables +- for name, value in tb_frame.f_locals.items(): +- cleansed.append((name, CLEANSED_SUBSTITUTE)) +- return cleansed +- else: +- # Cleanse specified variables +- for name, value in tb_frame.f_locals.items(): +- if name in sensitive_variables: +- value = CLEANSED_SUBSTITUTE +- elif isinstance(value, HttpRequest): +- # Cleanse the request's POST parameters. +- value = self.get_request_repr(value) +- cleansed.append((name, value)) +- return cleansed +- else: +- # Potentially cleanse only the request if it's one of the +- # frame variables. +- for name, value in tb_frame.f_locals.items(): +- if isinstance(value, HttpRequest): +- # Cleanse the request's POST parameters. +- value = self.get_request_repr(value) +- cleansed.append((name, value)) +- return cleansed +- + + class HorizonException(Exception): + """Base exception class for distinguishing our own exception classes.""" diff --git a/trusty/debian/patches/series b/trusty/debian/patches/series index 07a9f6c..aab60c2 100644 --- a/trusty/debian/patches/series +++ b/trusty/debian/patches/series @@ -12,3 +12,4 @@ 0120-fix-request.REQUEST-does-not-exist.patch 0130-remove-load-url-from-future.patch 0140-fix-assertRedirects-no-longer-forced-absolute-URLs.patch +0150-removed-redefinition-of-get_traceback_frame_variables.patch -- 2.45.2