-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add fabric stp * refactor convert range macro * remove f-strings * fix lint errors * update defaults * update to rule & temp update to template * remove unneeded rule checks * add initial version compare filter * more work on versioning and splitting templates * fix if clause & add placeholders * address review comments * remove backup file * address pipeline errors * fix vpc model path
- Loading branch information
Showing
7 changed files
with
144 additions
and
97 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
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
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
23 changes: 23 additions & 0 deletions
23
roles/validate/files/rules/required_rules/201_global_spanning_tree.py
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,23 @@ | ||
class Rule: | ||
id = "201" | ||
description = "Verify a spanning tree protocol mutually exclusive parameters." | ||
severity = "HIGH" | ||
|
||
@classmethod | ||
def match(cls, inventory): | ||
results = [] | ||
if inventory.get("vxlan", None): | ||
if inventory["vxlan"].get("global", None): | ||
if inventory["vxlan"].get("global", None).get("spanning_tree", None): | ||
root_bridge_protocol = inventory["vxlan"]["global"]["spanning_tree"].get("root_bridge_protocol", None) | ||
vlan_range = inventory["vxlan"]["global"]["spanning_tree"].get("vlan_range", None) | ||
mst_instance_range = inventory["vxlan"]["global"]["spanning_tree"].get("mst_instance_range", None) | ||
|
||
if vlan_range and mst_instance_range: | ||
results.append( | ||
"vxlan.global.spanning_tree.vlan_range and vxlan.global.spanning_tree.mst_instance_range " | ||
"both cannot be configured at the same time. Please choose one depending on the " | ||
"vxlan.global.spanning_tree.root_bridge_protocol selected." | ||
) | ||
|
||
return results |