Skip to content

front-ports and power-outlets component import failures #142

@vpogrebi

Description

@vpogrebi

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

  1. Import device type using 24-port-copper-patch-panel-half-depth.yaml file (manufacturer: Generic) from Nautobot devicetype-library. This YAML contains front-ports definitions.
  2. Observe import job failure
  3. Import device type using CPS1215RMS.yaml file (manufacturer: CyberPower) from Nautobot devicetype-library. This YAML contains power-outlets definitions.
  4. Observe import job failure

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions