diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2022-07-14 13:39:23 +0000 |
---|---|---|
committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2022-07-14 13:39:23 +0000 |
commit | 9ec0b176311e66ceb37018ced80673cfea1ad3b0 (patch) | |
tree | 3aa5d89cec1edab0636cf48ddee721daae516a03 /python | |
parent | 02104b8cb194ac4034ff60663523620bc3eaf01e (diff) | |
download | vyos-1x-9ec0b176311e66ceb37018ced80673cfea1ad3b0.tar.gz vyos-1x-9ec0b176311e66ceb37018ced80673cfea1ad3b0.zip |
netflow: T4532: Fix flow-accounting server IPv6 bug
Fix for IPv6 netflow_plugin name
When we use IPv6 uacctd.conf doesnt expect coluns in the plugin
name. Replace coluns to dash. Place IPv6 address into [] brackets
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/template.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py index f9e754357..88271125c 100644 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -151,6 +151,16 @@ def bracketize_ipv6(address): return f'[{address}]' return address +@register_filter('dot_colon_to_dash') +def dot_colon_to_dash(text): + """ Replace dot and colon to dash for string + Example: + 192.0.2.1 => 192-0-2-1, 2001:db8::1 => 2001-db8--1 + """ + text = text.replace(":", "-") + text = text.replace(".", "-") + return text + @register_filter('netmask_from_cidr') def netmask_from_cidr(prefix): """ Take CIDR prefix and convert the prefix length to a "subnet mask". |