mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
python 2->3 iteritems() in core templates
This commit is contained in:
parent
9e082449aa
commit
47a3b2419d
@ -4,7 +4,7 @@
|
||||
{% if TARGET_FILTERS['OPNsense.captiveportal.zones.zone.' ~ loop.index0] or TARGET_FILTERS['OPNsense.captiveportal.zones.zone'] %}
|
||||
{# found zone, search for interface ip #}
|
||||
{% for intf_tag in item.interfaces.split(',') %}
|
||||
{% for conf_key, conf_inf in interfaces.iteritems() %}
|
||||
{% for conf_key, conf_inf in interfaces.items() %}
|
||||
{% if conf_key == intf_tag and conf_inf.ipaddr != 'dhcp' %}
|
||||
{% do item.update({'interface_hostaddr':conf_inf.ipaddr}) %}
|
||||
{% endif %}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
{% set cp_interface_list = [] %}
|
||||
{% set no_cp_interface_list = [] %}
|
||||
{% if helpers.exists('OPNsense.captiveportal.zones.zone') %}
|
||||
{% for intf_key,interface in interfaces.iteritems()%}
|
||||
{% for intf_key,interface in interfaces.items()%}
|
||||
{% set is_cp=[] %}
|
||||
{% for cp_item in helpers.toList('OPNsense.captiveportal.zones.zone') %}
|
||||
{% for cp_intf in cp_item.interfaces.split(',') %}
|
||||
@ -21,7 +21,7 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for intf_key,interface in interfaces.iteritems() %}
|
||||
{% for intf_key,interface in interfaces.items() %}
|
||||
{% do no_cp_interface_list.append(interface) %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
# Setup regular listeners configuration
|
||||
{% if helpers.exists('OPNsense.proxy.forward.interfaces') %}
|
||||
{% for interface in OPNsense.proxy.forward.interfaces.split(",") %}
|
||||
{% for intf_key,intf_item in interfaces.iteritems() %}
|
||||
{% for intf_key,intf_item in interfaces.items() %}
|
||||
{% if intf_key == interface and intf_item.ipaddr != 'dhcp' %}
|
||||
{{ listener_config(intf_item.ipaddr, OPNsense.proxy.forward.port) }}
|
||||
{% endif %}
|
||||
@ -94,14 +94,14 @@ ftp_port [::1]:{{ OPNsense.proxy.forward.ftpPort }} intercept
|
||||
# Setup ftp proxy
|
||||
{% if helpers.exists('OPNsense.proxy.forward.ftpInterfaces') %}
|
||||
{% for interface in OPNsense.proxy.forward.ftpInterfaces.split(",") %}
|
||||
{% for intf_key,intf_item in interfaces.iteritems() %}
|
||||
{% for intf_key,intf_item in interfaces.items() %}
|
||||
{% if intf_key == interface and intf_item.ipaddr != 'dhcp' %}
|
||||
ftp_port {{intf_item.ipaddr}}:{{ OPNsense.proxy.forward.ftpPort }} accel ftp-track-dirs protocol=HTTP
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{# virtual ip's #}
|
||||
{% if helpers.exists('virtualip') %}
|
||||
{% for intf_key,intf_item in virtualip.iteritems() %}
|
||||
{% for intf_key,intf_item in virtualip.items() %}
|
||||
{% if intf_item.interface == interface and intf_item.mode == 'ipalias' %}
|
||||
ftp_port {{intf_item.subnet}}:{{ OPNsense.proxy.forward.ftpPort }} accel ftp-track-dirs protocol=HTTP
|
||||
{% endif %}
|
||||
@ -117,7 +117,7 @@ ftp_port {{intf_item.subnet}}:{{ OPNsense.proxy.forward.ftpPort }} accel ftp-tra
|
||||
{% if helpers.exists('OPNsense.proxy.forward.addACLforInterfaceSubnets') %}
|
||||
{% if OPNsense.proxy.forward.addACLforInterfaceSubnets == '1' %}
|
||||
{% for interface in OPNsense.proxy.forward.interfaces.split(",") %}
|
||||
{% for intf_key,intf_item in interfaces.iteritems() %}
|
||||
{% for intf_key,intf_item in interfaces.items() %}
|
||||
{% if intf_key == interface and intf_item.ipaddr != 'dhcp' %}
|
||||
acl localnet src {{ helpers.getIPNetwork(intf_item.ipaddr+'/'+intf_item.subnet)[0].format() }}/{{intf_item.subnet}} # Possible internal network (interfaces v4)
|
||||
{% endif %}
|
||||
|
||||
@ -9,7 +9,7 @@ all of the config.xml data when rendering this template, we have to filter the p
|
||||
|
||||
For example, only use this interfaces data:
|
||||
|
||||
{% for key,item in interfaces.iteritems() %}
|
||||
{% for key,item in interfaces.items() %}
|
||||
{% if TARGET_FILTERS['interfaces.'+key] %}
|
||||
my interface name is {{ key }}, connected to {{ item.if }} using {{ item.ipaddr }}
|
||||
{% endif %}
|
||||
|
||||
@ -10,7 +10,7 @@ version according to config.xml : {{ version|default('?') }}
|
||||
|
||||
list of configured network interfaces :
|
||||
|
||||
{% for key,item in interfaces.iteritems() %}
|
||||
{% for key,item in interfaces.items() %}
|
||||
interface {{ key }}
|
||||
--- interface {{ item.if }}
|
||||
--- address {{ item.ipaddr }}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user