-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Environment
- Python version: 3.10.16
- Nautobot version: Example: 2.4.17
- nautobot-welcome-wizard version: 2.0.0
Expected Behavior
Device type import using YAML file that includes front-ports or power-outlets configurations - should successfully create FrontPortTemplate or PowerOutletTemplate templates correspondingly.
Observed Behavior
Device type imports that includes front-ports or power-outlets configurations - fail, generating errors like this:
PowerOutletTemplate() got unexpected keyword arguments: 'power_port'
FrontPortTemplate() got unexpected keyword arguments: 'rear_port'
After excluding these parameters (adding them to STRIP_KEYWORDS), other errors are generated - indicating missed template references:
psycopg2.errors.NotNullViolation: null value in column "rear_port_template_id" of relation "dcim_frontporttemplate" violates not-null constraint
Nautobot's FrontPortTemplate and PowerOutletTemplate models have required attributes rear_port_template and power_port_template correspondingly (foreign keys to RearPortTemplate and PowerPortTemplate instances) - thus requiring obtaining corresponding template instance ids and using them as a references (foreign key) when creating front port and power outlet template. These relationships are entirely missed in the import_device_type() implementation.
Steps to Reproduce
- Import device type using
24-port-copper-patch-panel-half-depth.yamlfile (manufacturer:Generic) from Nautobot devicetype-library. This YAML containsfront-portsdefinitions. - Observe import job failure
- Import device type using
CPS1215RMS.yamlfile (manufacturer:CyberPower) from Nautobot devicetype-library. This YAML containspower-outletsdefinitions. - Observe import job failure