diff options
Diffstat (limited to 'python/vyos/template.py')
-rw-r--r-- | python/vyos/template.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py index cdcbdc6c3..a4fff649c 100644 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -523,10 +523,17 @@ def get_esp_ike_cipher(group_config, ike_group=None): return ciphers @register_filter('get_uuid') -def get_uuid(interface): +def get_uuid(seed): """ Get interface IP addresses""" - from uuid import uuid1 - return uuid1() + if seed: + from hashlib import md5 + from uuid import UUID + tmp = md5() + tmp.update(seed.encode('utf-8')) + return str(UUID(tmp.hexdigest())) + else: + from uuid import uuid1 + return uuid1() openvpn_translate = { 'des': 'des-cbc', |