-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from aedwardstx/issue_104
rm overmatching tacacs-server idempotency rule for nxos
- Loading branch information
Showing
3 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
[tool.poetry] | ||
name = "hier-config" | ||
version = "2.2.0" | ||
version = "2.2.1" | ||
description = "A network configuration comparison tool, used to build remediation configurations." | ||
packages = [ | ||
{ include="hier_config", from="."}, | ||
] | ||
authors = [ | ||
"Andrew Edwards <andrew.edwards@rackspace.com>", | ||
"Andrew Edwards <edwards.andrew@heb.com>", | ||
"James Williams <[email protected]", | ||
"Jan Brooks <[email protected]" | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from hier_config import HConfig, Host | ||
|
||
|
||
def test_issue104() -> None: | ||
running_config_raw = ( | ||
"tacacs-server deadtime 3\n" "tacacs-server host 192.168.1.99 key 7 Test12345\n" | ||
) | ||
generated_config_raw = ( | ||
"tacacs-server host 192.168.1.98 key 0 Test135 timeout 3\n" | ||
"tacacs-server host 192.168.100.98 key 0 test135 timeout 3\n" | ||
) | ||
|
||
host = Host(hostname="test", os="nxos") | ||
running_config = HConfig(host=host) | ||
running_config.load_from_string(running_config_raw) | ||
generated_config = HConfig(host=host) | ||
generated_config.load_from_string(generated_config_raw) | ||
rem = running_config.config_to_get_to(generated_config) | ||
expected_rem_lines = { | ||
"no tacacs-server deadtime 3", | ||
"no tacacs-server host 192.168.1.99 key 7 Test12345", | ||
"tacacs-server host 192.168.1.98 key 0 Test135 timeout 3", | ||
"tacacs-server host 192.168.100.98 key 0 test135 timeout 3", | ||
} | ||
rem_lines = {line.cisco_style_text() for line in rem.all_children()} | ||
assert expected_rem_lines == rem_lines |