summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-12-19 23:00:13 +0100
committerChristian Poessinger <christian@poessinger.com>2019-12-20 14:42:50 +0100
commit49ee763a1892b011213446f5ccb12b53fbbd1622 (patch)
tree5a337bf62a63b0ab60b59babe3b0922adfe1f6a3 /src
parentafdee28b8227eb21494c3dddddbe95045c4df91d (diff)
downloadvyos-1x-49ee763a1892b011213446f5ccb12b53fbbd1622.tar.gz
vyos-1x-49ee763a1892b011213446f5ccb12b53fbbd1622.zip
igmp-proxy: T1893: rename 'interface' dictionary key to 'interfaces'
(cherry picked from commit 9a0f6371be5ef97974a4cc6d8f4fb97c3f9741ac)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/igmp_proxy.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/conf_mode/igmp_proxy.py b/src/conf_mode/igmp_proxy.py
index b994369af..37744535e 100755
--- a/src/conf_mode/igmp_proxy.py
+++ b/src/conf_mode/igmp_proxy.py
@@ -50,17 +50,17 @@ config_tmpl = """
quickleave
{% endif -%}
-{% for i in interface %}
-# Configuration for {{ i.interface }} ({{ i.role }} interface)
-{% if i.role == 'disabled' -%}
-phyint {{ i.interface }} disabled
+{% for interface in interfaces %}
+# Configuration for {{ interface.interface }} ({{ interface.role }} interface)
+{% if interface.role == 'disabled' -%}
+phyint {{ interface.interface }} disabled
{%- else -%}
-phyint {{ i.interface }} {{ i.role }} ratelimit 0 threshold {{ i.threshold }}
+phyint {{ interface.interface }} {{ interface.role }} ratelimit 0 threshold {{ interface.threshold }}
{%- endif -%}
-{%- for subnet in i.alt_subnet %}
+{%- for subnet in interface.alt_subnet %}
altnet {{ subnet }}
{%- endfor %}
-{%- for subnet in i.whitelist %}
+{%- for subnet in interface.whitelist %}
whitelist {{ subnet }}
{%- endfor %}
{% endfor %}
@@ -69,7 +69,7 @@ phyint {{ i.interface }} {{ i.role }} ratelimit 0 threshold {{ i.threshold }}
default_config_data = {
'disable': False,
'disable_quickleave': False,
- 'interface': [],
+ 'interfaces': [],
}
def get_config():
@@ -111,7 +111,7 @@ def get_config():
interface['whitelist'] = conf.return_values('whitelist')
# Append interface configuration to global configuration list
- igmp_proxy['interface'].append(interface)
+ igmp_proxy['interfaces'].append(interface)
return igmp_proxy
@@ -125,12 +125,12 @@ def verify(igmp_proxy):
return None
# at least two interfaces are required, one upstream and one downstream
- if len(igmp_proxy['interface']) < 2:
+ if len(igmp_proxy['interfaces']) < 2:
raise ConfigError('Must define an upstream and at least 1 downstream interface!')
upstream = 0
- for i in igmp_proxy['interface']:
- if "upstream" == i['role']:
+ for interface in igmp_proxy['interfaces']:
+ if "upstream" == interface['role']:
upstream += 1
if upstream == 0: