summaryrefslogtreecommitdiff
path: root/python/vyos/template.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-12-27 11:43:27 +0100
committerChristian Poessinger <christian@poessinger.com>2020-12-28 19:42:50 +0100
commiteeb78e842423319169b036d16601e73227dbffdd (patch)
tree282dac56ecfccf381fa92ad9027df6779d16ae2f /python/vyos/template.py
parent1efd20ab21e75e421487d563fc794a7f97361a3e (diff)
downloadvyos-1x-eeb78e842423319169b036d16601e73227dbffdd.tar.gz
vyos-1x-eeb78e842423319169b036d16601e73227dbffdd.zip
webproxy: T563: squidguard: support default ruleset
Diffstat (limited to 'python/vyos/template.py')
-rw-r--r--python/vyos/template.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py
index 63d400642..bf087c223 100644
--- a/python/vyos/template.py
+++ b/python/vyos/template.py
@@ -248,7 +248,6 @@ def dec_ip(address, decrement):
from ipaddress import ip_interface
return str(ip_interface(address).ip - int(decrement))
-
@register_filter('isc_static_route')
def isc_static_route(subnet, router):
# https://ercpe.de/blog/pushing-static-routes-with-isc-dhcp-server
@@ -270,3 +269,9 @@ def isc_static_route(subnet, router):
string += ','.join(router.split('.'))
return string
+
+@register_filter('is_file')
+def is_file(filename):
+ if os.path.exists(filename):
+ return os.path.isfile(filename)
+ return False