Module Bay Type restricted validation in configuration.py and module filter selection
type: featurestatus: needs triagenetbox
### NetBox version
v4.7.0-beta1
### Feature type
Change to existing functionality
### Proposed functionality
Implement in [configuration.py](<http://configuration.py>) an optional configuration parameter, named for example: STRICT_MODULE_BAY_TYPE, that defaults to 'no' if not specified, and if changed to STRICT_MODULE_BAY_TYPE=yes, changes the validation of module_bay_types using two new rules:
(1) If a module bay has one or more 'module bay types', forbid the users to assign any module type without 'module bay types assigned. <br>(2) If a module type has one or more 'module bay types', forbid the user to assign this module type to any module bay without module bay types assign.
**UI CHANGE** If a module bay has one or more 'module bay types', the filter must show only the module types that has common 'module bay types', hidding incompatible module types.
<img src="https://github.com/user-attachments/assets/1837491f-5adb-447a-9fd7-a8bd82747d4a " alt="Image" width="1432" data-linear-height="371" />
### Use case
With the long waited netbox-community/netbox#19731 feature implemented, the default validation when the user install a module in a device was a backyards compatibility mode, that does not breaks the currently existing devices / modules when a new 'Module Bay Type' was gradually implemented, so it defaults to if the 'module bay' side or the 'module type' side does not have any 'Module Bay Type' assigned the validation "passes", allowing the module to be installed.
The proposed change, implemented as a configuration parameter, will not be in effect, unless the user explicitly turn it on in [configuration.py](<http://configuration.py>), so does not breaks the intended adoptation of the new feature.
In some cases the user **wants** to enforce the module compatibility, even if starts with only one or two device types that has some of the module types already with the "Module Bay Type" assigned. This will prevent, for example, that an device that already have a 'Linecard / Vendor xxx' "Module Bay Type" assigned, to allow the installation of a MPO Cassete that does not have (yet) any "Module Bay Type" assigned.
The "Filter Button" in module installation form is one of the most requested final user feature that complains <br>that netbox shows a very large number of module types possible of installation on a particular module bay position, including several eye catching error options - like putting a fan inside an ODF, or others engineering errors that can be prevented by showing only the allowed compatible module types - for example, a QSFP28 module bay that only accepts 100GBPS transceiver, but not a 50 GBPS transceiver. If all the 100GBPS transceiver already have "Module Bay Type", but the 50 GBPS transceiver does not have, yet, the user can chooses the wrong type.
Another use case is when the user already has a custom validation (our company case) logic implemented, and wants to migrate these logic to netbox native netbox-community/netbox#19731 feature, and remove the custom validation logic. If the 'loose' default validation remains, the user will be able to install incompatible modules.
### Database changes
I dont see any database change requirement.
### External dependencies
I dont see any external dependency change.
1 条评论