nautobot-app-ssot icon indicating copy to clipboard operation
nautobot-app-ssot copied to clipboard

Move class validation checks to `__init__`

Open Renrut5 opened this issue 2 months ago • 2 comments

Class nautobot_ssot.contrib.adapter.NautobotAdapter has class validations in load() method.

https://github.com/nautobot/nautobot-app-ssot/blob/b738e05eb9663b1d7bc8507cf7ddecaaa57ea31d/nautobot_ssot/contrib/adapter.py#L155-L156

Propose moving to __init__ method to validate class earlier on during instantiation instead of load().

A number of existing integrations using NautobotAdapter will be impacted by this change and will need there test adapters updated to pass the class validations.

Goal is to better organize the code with a common-sense location for class validation while also raising errors earlier, if able. This falls under general maintenance, improvements and optimizations.

Renrut5 avatar Sep 29 '25 18:09 Renrut5

What is the goal with this? It may help drive the conversation

itdependsnetworks avatar Sep 29 '25 19:09 itdependsnetworks

What is the goal with this? It may help drive the conversation

@itdependsnetworks , updated description

Renrut5 avatar Sep 29 '25 19:09 Renrut5