mirror of
https://github.com/thatmattlove/hyperglass.git
synced 2026-01-17 08:48:05 +00:00
Fixed validation of no condition rules
Previously, when processing rules with no condition, an extra RuleWithPattern rule was also added to the rule list causing a validation error. This has been corrected. Signed-off-by: Mattie Nickson <mnickson@sidingsmedia.com>
This commit is contained in:
parent
d653461b5d
commit
6d132e27b4
1 changed files with 9 additions and 8 deletions
|
|
@ -282,6 +282,7 @@ class Directive(HyperglassUniqueModel, unique_by=("id", "table_output")):
|
||||||
condition = rule.get("condition")
|
condition = rule.get("condition")
|
||||||
if condition is None:
|
if condition is None:
|
||||||
out_rules.append(RuleWithoutValidation(**rule))
|
out_rules.append(RuleWithoutValidation(**rule))
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
condition_net = ip_network(condition)
|
condition_net = ip_network(condition)
|
||||||
if condition_net.version == 4:
|
if condition_net.version == 4:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue