-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dcnm_fabric: Fix evaluation of controller features (#362)
* Fix determination of controller features 1. Fix dictionary access in Merged.get_need() and Replaced.get_need() In the above methods, we were trying to retrieve the key "fabric_type" from the dict self.features. But this dict is keyed on the fabric type (e.g. keys in this dict are "ISN", "VXLAN_EVPN", etc). The fix is to remove the quotes around "fabric_type" -> fabric_type, which is a var containing the fabric type ("ISN", "VXLAN_EVPN", etc). 2. Add backward-compatible feature verification for ND 4.0. The NDFC versions (as returned by ControllerVersion) for ND 3.2.1e and ND 4.0 respectively are: 12.2.2.238 -> ND 3.2.1e 12.3.1.248 -> ND 4.0 The unified architecture for ND 4.0 means that it no longer includes information about controller features relevant to fabrics (e.g. that "vxlan" feature must be enabled for VXLAN_EVPN fabric creation/modification, and "pmn" feature must be enabled for IPFM fabric creation/modification, etc). Hence, this check should be run only for NDFC minor versions less than 3. Added call to ControllerVersion() and updated the check in get_need() such that we skip the check if ControllerVersion().version_minor < 3. 3. Updated docstrings in controller_version.py Updated accessor property docstrings in ControllerVersion() to explicitely mention that a string is returned for version_major, version_minor, and version_patch. * Centralize function to distinguish ND 4.0 from ND 3.x We will probably need a way to tell ND 4.0 from ND 3.x in other modules at some point. 1. Add a property to ControllerVersion() that returns True if ND 4.x and False otherwise. 2. Leverage this property in dcnm_fabric.py Merged.get_need() and Replaced.get_need() * Add unit tests for ControllerVersion().is_controller_version_4x Add two unit tests to verify correct values are returned for ND 3.x and ND 4.x NDFC versions.
- Loading branch information
1 parent
9e49fc9
commit cfac22b
Showing
4 changed files
with
166 additions
and
6 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