Fix to - eos_vlans using state parameter replaced is giving odd behavior (#67318)

* Added fix for bug # 54400

* Adding files for RM static_routes

* Added Integration tests

* Revert "Added fix for bug # 54400"

This reverts commit bf42db4269.

* Revert "Adding files for RM static_routes"

This reverts commit dafdd92d43.

* Revert "Added Integration tests"

This reverts commit 129dc87682.

* Adding files for RM static_routes

* Added Integration tests

* Corrected lint errors

* Added fix for bug # 54400

* Revert "Added fix for bug # 54400"

This reverts commit bf42db4269.

* Revert "Adding files for RM static_routes"

This reverts commit dafdd92d43.

* Revert "Added Integration tests"

This reverts commit 129dc87682.

* fix to bug #67313

* fixing rebase issue

* fixing rebase issue

* addressed review comments

* addressed review comments
This commit is contained in:
GomathiselviS 2020-02-12 11:12:12 -05:00 committed by GitHub
parent cd146b836e
commit 4ec1437212
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View file

@ -208,16 +208,17 @@ def generate_commands(vlan_id, to_set, to_remove):
if "vlan_id" in to_remove:
return ["no vlan {0}".format(vlan_id)]
for key in to_remove:
if key in to_set.keys():
continue
commands.append("no {0}".format(key))
for key, value in to_set.items():
if key == "vlan_id" or value is None:
continue
commands.append("{0} {1}".format(key, value))
for key in to_remove:
commands.append("no {0}".format(key))
if commands:
commands.insert(0, "vlan {0}".format(vlan_id))
return commands

View file

@ -5,6 +5,7 @@
config:
- vlan_id: 20
state: suspend
name: twentyreplaced
other_config:
- vlan_id: 10
name: ten

View file

@ -102,12 +102,12 @@ class TestEosVlansModule(TestEosModule):
self.execute_show_command.return_value = []
set_module_args(dict(
config=[dict(
vlan_id=30,
name="thirty",
vlan_id=10,
name="tenreplaced",
state="suspend"
)], state="replaced"
))
commands = ['vlan 30', 'name thirty', 'state suspend']
commands = ['vlan 10', 'name tenreplaced', 'state suspend']
self.execute_module(changed=True, commands=commands)
def test_eos_vlan_replaced_idempotent(self):