summaryrefslogtreecommitdiff
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:41:17 +0100
commit9a0f6371be5ef97974a4cc6d8f4fb97c3f9741ac (patch)
tree93c4f987a5fad4912d4b54af2c897e51d5d4f5cd
parenta124fb5c0555444acb45c9a23cbeff1159cac4c7 (diff)
downloadvyos-1x-9a0f6371be5ef97974a4cc6d8f4fb97c3f9741ac.tar.gz
vyos-1x-9a0f6371be5ef97974a4cc6d8f4fb97c3f9741ac.zip
igmp-proxy: T1893: rename 'interface' dictionary key to 'interfaces'
-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: