From 324aefeeef1a1d6f7aea05954a336042376eadec Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 3 Jun 2020 14:13:18 -0400 Subject: [PATCH] Dropped backward compatibility for 'webhooks' Redis queue --- docs/release-notes/version-2.9.md | 1 + netbox/netbox/settings.py | 17 ++++------------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/docs/release-notes/version-2.9.md b/docs/release-notes/version-2.9.md index be6004feb..31dc0be02 100644 --- a/docs/release-notes/version-2.9.md +++ b/docs/release-notes/version-2.9.md @@ -16,3 +16,4 @@ NetBox v2.9 replaces Django's built-in permissions framework with one that suppo * The `secrets.activate_userkey` permission no longer exists. Instead, `secrets.change_userkey` is checked to determine whether a user has the ability to activate a UserKey. * The `users.delete_token` permission is no longer enforced. All users are permitted to delete their own API tokens. +* Backward compatibility for the `webhooks` Redis queue configuration has been dropped. (Use `tasks` instead.) diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 692382262..eb9fab57a 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -195,19 +195,11 @@ if STORAGE_CONFIG and STORAGE_BACKEND is None: # # Background task queuing -if 'tasks' in REDIS: - TASKS_REDIS = REDIS['tasks'] -elif 'webhooks' in REDIS: - # TODO: Remove support for 'webhooks' name in v2.9 - warnings.warn( - "The 'webhooks' REDIS configuration section has been renamed to 'tasks'. Please update your configuration as " - "support for the old name will be removed in a future release." - ) - TASKS_REDIS = REDIS['webhooks'] -else: +if 'tasks' not in REDIS: raise ImproperlyConfigured( "REDIS section in configuration.py is missing the 'tasks' subsection." ) +TASKS_REDIS = REDIS['tasks'] TASKS_REDIS_HOST = TASKS_REDIS.get('HOST', 'localhost') TASKS_REDIS_PORT = TASKS_REDIS.get('PORT', 6379) TASKS_REDIS_SENTINELS = TASKS_REDIS.get('SENTINELS', []) @@ -222,12 +214,11 @@ TASKS_REDIS_DEFAULT_TIMEOUT = TASKS_REDIS.get('DEFAULT_TIMEOUT', 300) TASKS_REDIS_SSL = TASKS_REDIS.get('SSL', False) # Caching -if 'caching' in REDIS: - CACHING_REDIS = REDIS['caching'] -else: +if 'caching' not in REDIS: raise ImproperlyConfigured( "REDIS section in configuration.py is missing caching subsection." ) +CACHING_REDIS = REDIS['caching'] CACHING_REDIS_HOST = CACHING_REDIS.get('HOST', 'localhost') CACHING_REDIS_PORT = CACHING_REDIS.get('PORT', 6379) CACHING_REDIS_SENTINELS = CACHING_REDIS.get('SENTINELS', [])