summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-01-30 10:56:38 +0200
committerGitHub <noreply@github.com>2023-01-30 10:56:38 +0200
commit3c750f9b12b54d872848f6571deb02245ba8e28a (patch)
treee23d8bac780a9787c5763b8618fa7591a8fe8270 /python
parent6eea12512e59cc28f5c2e5ca5ec7e9e7b21731da (diff)
parent7ae0b404ad9fdefa856c7e450b224b47d854a4eb (diff)
downloadvyos-1x-3c750f9b12b54d872848f6571deb02245ba8e28a.tar.gz
vyos-1x-3c750f9b12b54d872848f6571deb02245ba8e28a.zip
Merge pull request #1761 from sever-sever/T4916-curr
T4916: Rewrite IPsec peer authentication and psk migration
Diffstat (limited to 'python')
-rw-r--r--python/vyos/template.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py
index ce9983958..15240f815 100644
--- a/python/vyos/template.py
+++ b/python/vyos/template.py
@@ -193,6 +193,16 @@ def dot_colon_to_dash(text):
text = text.replace(".", "-")
return text
+@register_filter('generate_uuid4')
+def generate_uuid4(text):
+ """ Generate random unique ID
+ Example:
+ % uuid4()
+ UUID('958ddf6a-ef14-4e81-8cfb-afb12456d1c5')
+ """
+ from uuid import uuid4
+ return uuid4()
+
@register_filter('netmask_from_cidr')
def netmask_from_cidr(prefix):
""" Take CIDR prefix and convert the prefix length to a "subnet mask".