Skip to content
Snippets Groups Projects
Commit 3d42edc1 authored by Tomáš Čejka's avatar Tomáš Čejka
Browse files

flowspy: disable duplicates checking for new routes

To disable checking of duplicates during the creation of new rules, variable
ROUTES_DUPLICATES_CHECKING can be set to False.
parent 2596064c
Branches
No related tags found
No related merge requests found
...@@ -196,6 +196,8 @@ def check_if_rule_exists(fields, queryset): ...@@ -196,6 +196,8 @@ def check_if_rule_exists(fields, queryset):
:rtype: tuple(bool, str) :rtype: tuple(bool, str)
""" """
if hasattr(settings, "ROUTES_DUPLICATES_CHECKING") and settings.ROUTES_DUPLICATES_CHECKING == False:
return (False, None)
routes = queryset.filter( routes = queryset.filter(
source=fields.get('source'), source=fields.get('source'),
destination=ip_network(fields.get('destination')).compressed, destination=ip_network(fields.get('destination')).compressed,
......
...@@ -470,6 +470,10 @@ SNMP_REMOVE_RULES_AFTER = 3600 ...@@ -470,6 +470,10 @@ SNMP_REMOVE_RULES_AFTER = 3600
DISABLE_RULE_OVERLAP_CHECK = False DISABLE_RULE_OVERLAP_CHECK = False
# Perform checking for route duplicates (i.e., forbid creating multiple rules
# with the same addresses). By default it is enabled (True).
ROUTES_DUPLICATES_CHECKING = True
ALLOW_DELETE_FULL_FOR_NONADMIN = False ALLOW_DELETE_FULL_FOR_NONADMIN = False
MAIL_NOTIFICATION_TO_ALL_MATCHING_PEERS = True MAIL_NOTIFICATION_TO_ALL_MATCHING_PEERS = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment