summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interface-definitions/include/rip/version.xml.i7
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_rip.py16
-rwxr-xr-xsrc/conf_mode/protocols_rip.py15
3 files changed, 11 insertions, 27 deletions
diff --git a/interface-definitions/include/rip/version.xml.i b/interface-definitions/include/rip/version.xml.i
index f7d3eab0d..a35350aee 100644
--- a/interface-definitions/include/rip/version.xml.i
+++ b/interface-definitions/include/rip/version.xml.i
@@ -1,19 +1,18 @@
<!-- include start from rip/version.xml.i -->
<leafNode name="version">
<properties>
- <help>RIP protocol version</help>
+ <help>Limit RIP protocol version</help>
<valueHelp>
<format>1</format>
- <description>RIPv1</description>
+ <description>Allow RIPv1 only</description>
</valueHelp>
<valueHelp>
<format>2</format>
- <description>RIPv2</description>
+ <description>Allow RIPv2 only</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-2"/>
</constraint>
</properties>
- <defaultValue>2</defaultValue>
</leafNode>
<!-- include end -->
diff --git a/smoketest/scripts/cli/test_protocols_rip.py b/smoketest/scripts/cli/test_protocols_rip.py
index 8c100d537..11385adb5 100755
--- a/smoketest/scripts/cli/test_protocols_rip.py
+++ b/smoketest/scripts/cli/test_protocols_rip.py
@@ -159,24 +159,24 @@ class TestProtocolsRIP(VyOSUnitTestSHIM.TestCase):
self.assertNotIn(zebra_route_map, frrconfig)
def test_rip_03_version(self):
- version = '1'
+ rx_version = '1'
+ tx_version = '2'
interface = 'eth0'
- self.cli_set(base_path + ['version', version])
- self.cli_set(base_path + ['interface', interface, 'send', 'version', version])
- self.cli_set(base_path + ['interface', interface, 'receive', 'version', version])
+ self.cli_set(base_path + ['version', tx_version])
+ self.cli_set(base_path + ['interface', interface, 'send', 'version', tx_version])
+ self.cli_set(base_path + ['interface', interface, 'receive', 'version', rx_version])
# commit changes
self.cli_commit()
# Verify FRR configuration
frrconfig = self.getFRRconfig('router rip')
- self.assertIn(f'version {version}', frrconfig)
+ self.assertIn(f'version {tx_version}', frrconfig)
frrconfig = self.getFRRconfig(f'interface {interface}')
- self.assertIn(f' ip rip receive version {version}', frrconfig)
- self.assertIn(f' ip rip send version {version}', frrconfig)
-
+ self.assertIn(f' ip rip receive version {rx_version}', frrconfig)
+ self.assertIn(f' ip rip send version {tx_version}', frrconfig)
if __name__ == '__main__':
unittest.main(verbosity=2)
diff --git a/src/conf_mode/protocols_rip.py b/src/conf_mode/protocols_rip.py
index e29b23765..c78d90396 100755
--- a/src/conf_mode/protocols_rip.py
+++ b/src/conf_mode/protocols_rip.py
@@ -56,24 +56,9 @@ def get_config(config=None):
# We have gathered the dict representation of the CLI, but there are default
# options which we need to update into the dictionary retrived.
default_values = defaults(base)
-
- # T2665: we can not blend in default values of tagNodes - delete and add
- # individual values later on ...
- if 'interface' in default_values:
- del default_values['interface']
# merge in remaining default values
rip = dict_merge(default_values, rip)
- # T2665: add individual per interface defaults
-
- # T2665: blend in per interface defaults
- if 'interface' in rip:
- default_values = defaults(base + ['interface'])
- for interface in rip['interface']:
- # merge in default values
- rip['interface'][interface] = dict_merge(default_values,
- rip['interface'][interface])
-
# We also need some additional information from the config, prefix-lists
# and route-maps for instance. They will be used in verify().
#