Projet

Général

Profil

0001-debian-add-fixup-to-test-29149.patch

Nicolas Roche, 18 avril 2020 20:37

Télécharger (3,83 ko)

Voir les différences:

Subject: [PATCH] debian: add fixup to test (#29149)

 debian/debian_config_common.py | 8 ++++++--
 hobo/logger.py                 | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)
debian/debian_config_common.py
258 258

  
259 259
if 'MIDDLEWARE' not in globals():
260 260
    MIDDLEWARE = global_settings.MIDDLEWARE
261 261

  
262 262
if 'MIDDLEWARE_CLASSES' in globals():
263 263
    MIDDLEWARE_CLASSES = (
264 264
        'hobo.middleware.VersionMiddleware',  # /__version__
265 265
        'hobo.middleware.cors.CORSMiddleware',
266
        'hobo.middleware.debug.InternalIPMiddleware',
266 267
    ) + MIDDLEWARE_CLASSES
267 268

  
268 269
    if PROJECT_NAME != 'wcs' and 'authentic2' not in INSTALLED_APPS:
269 270
        MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
270 271
            'mellon.middleware.PassiveAuthenticationMiddleware',
271 272
        )
272 273

  
273 274
    if 'authentic2' in INSTALLED_APPS:
......
275 276
            'hobo.agent.authentic2.middleware.ProvisionningMiddleware',
276 277
        )
277 278
else:
278 279
    MIDDLEWARE = (
279 280
        'hobo.middleware.VersionMiddleware',  # /__version__
280 281
        'hobo.middleware.cors.CORSMiddleware',
281 282
    ) + MIDDLEWARE
282 283

  
284
    if PROJECT_NAME != 'wcs':
285
        MIDDLEWARE = MIDDLEWARE + (
286
            'hobo.middleware.debug.InternalIPMiddleware',
287
        )
288

  
283 289
    if PROJECT_NAME != 'wcs' and 'authentic2' not in INSTALLED_APPS:
284 290
        MIDDLEWARE = MIDDLEWARE + (
285 291
            'mellon.middleware.PassiveAuthenticationMiddleware',
286 292
        )
287 293

  
288 294
    if 'authentic2' in INSTALLED_APPS:
289 295
        MIDDLEWARE = MIDDLEWARE + (
290 296
            'hobo.agent.authentic2.middleware.ProvisionningMiddleware',
......
371 377
    MELLON_DEFAULT_ASSERTION_CONSUMER_BINDING = 'artifact'
372 378
    MELLON_OPENED_SESSION_COOKIE_NAME = 'A2_OPENED_SESSION'
373 379
    MELLON_ADD_AUTHNREQUEST_NEXT_URL_EXTENSION = True
374 380

  
375 381
if 'MIDDLEWARE_CLASSES' in globals():
376 382
    MIDDLEWARE_CLASSES = (
377 383
        'hobo.middleware.utils.StoreRequestMiddleware',
378 384
        'hobo.middleware.xforwardedfor.XForwardedForMiddleware',
379
        'hobo.middleware.debug.InternalIPMiddleware',
380 385
    ) + MIDDLEWARE_CLASSES
381 386

  
382 387
    MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
383 388
        'hobo.middleware.PrometheusStatsMiddleware',)
384 389
else:
385 390
    MIDDLEWARE = (
386 391
        'hobo.middleware.utils.StoreRequestMiddleware',
387 392
        'hobo.middleware.xforwardedfor.XForwardedForMiddleware',
388
        'hobo.middleware.debug.InternalIPMiddleware',
389 393
    ) + MIDDLEWARE
390 394

  
391 395
    MIDDLEWARE = MIDDLEWARE + (
392 396
        'hobo.middleware.PrometheusStatsMiddleware',)
393 397

  
394 398

  
395 399
HOBO_MANAGER_HOMEPAGE_URL_VAR = 'portal_agent_url'
396 400
HOBO_MANAGER_HOMEPAGE_TITLE_VAR = 'portal_agent_title'
hobo/logger.py
123 123

  
124 124
class ForceDebugFilter(logging.Filter):
125 125
    def filter(self, record):
126 126
        record.levelno = logging.DEBUG
127 127
        record.levelname = 'DEBUG'
128 128
        return super(ForceDebugFilter, self).filter(record)
129 129

  
130 130

  
131
class DebugLogFilter(object):
131
class DebugLogFilter(RequestContextFilter):
132 132
    '''Filter debug log records based on the DEBUG_LOG setting'''
133 133

  
134 134
    def filter(self, record):
135
        super(DebugLogFilter, self).filter(record)
135 136
        debug_log = getattr(settings, 'DEBUG_LOG', False)
136 137

  
137 138
        if debug_log is False:
138 139
            return False
139 140
        elif debug_log is True:
140 141
            return True
141 142
        elif hasattr(debug_log, 'encode'):
142 143
            # debug_log is a string
143
-