Przeglądaj źródła

Dropped backward compatibility for 'webhooks' Redis queue

Jeremy Stretch 5 lat temu
rodzic
commit
b31cc89478
2 zmienionych plików z 5 dodań i 13 usunięć
  1. 1 0
      docs/release-notes/version-2.9.md
  2. 4 13
      netbox/netbox/settings.py

+ 1 - 0
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.)

+ 4 - 13
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', [])