Skip to content

When creating Device, including rack="<rack_name>" causes silent failure. #60

@ndelregno

Description

@ndelregno

Diode SDK Python version

v1.3.0

Diode version

v1.3.0

Diode NetBox Plugin version

v1.3.0

NetBox version

v1.10.4

Steps to reproduce

From the example code, and modified for our purposes:

        device = Device(
            name="PDU-35 CKT#14 Outlet Box",
            device_type="4-port Outlet Box",
            role="Power Outlet Box",
            tenant="RCN Infrastructure",
            site="RCN Lab",
#            rack="102",
            status="active",
            manufacturer="Bell",
        )

works. A new device is created and visible under Devices.

However, when the line is uncommented, the device is not created and there is no indication of a failure:

        device = Device(
            name="PDU-35 CKT#14 Outlet Box",
            device_type="4-port Outlet Box",
            role="Power Outlet Box",
            tenant="RCN Infrastructure",
            site="RCN Lab",
            rack="102",
            status="active",
            manufacturer="Bell",
        )

From Pycharm:

"E:\Google Drive\My Drive\PycharmProjects\netboxIPAddressing\.venv\Scripts\python.exe" "E:\Google Drive\My Drive\PycharmProjects\NetboxDiode\helloWorld.py" 

Process finished with exit code 0

Expected behavior

According to ingester.py in the library:

    def __new__(
        cls,
        name: str | None = None,
        device_type: str | DeviceType | pb.DeviceType | None = None,
        role: str | DeviceRole | pb.DeviceRole | None = None,
        tenant: str | Tenant | pb.Tenant | None = None,
        platform: str | Platform | pb.Platform | None = None,
        serial: str | None = None,
        asset_tag: str | None = None,
        site: str | Site | pb.Site | None = None,
        location: str | Location | pb.Location | None = None,
        rack: str | Rack | pb.Rack | None = None,
        position: float | None = None,
        face: str | None = None,
        latitude: float | None = None,
        longitude: float | None = None,
        status: str | None = None,
        airflow: str | None = None,
        primary_ip4: str | IPAddress | pb.IPAddress | None = None,
        primary_ip6: str | IPAddress | pb.IPAddress | None = None,
        oob_ip: str | IPAddress | pb.IPAddress | None = None,
        cluster: str | Cluster | pb.Cluster | None = None,
        virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None,
        vc_position: int | None = None,
        vc_priority: int | None = None,
        description: str | None = None,
        comments: str | None = None,
        tags: list[str | Tag | pb.Tag] | None = None,
        custom_fields: dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None = None,
        # shortcuts
        manufacturer: str | Manufacturer | pb.Manufacturer = None,
    ) -> pb.Device:

rack, and many other options, are available in the IDE.

I would expect the Device to be created and associated with the appropriate rack.

Observed behavior

As shown in the steps to reproduce, the observed behavior is that the Device is NOT created and there is no error message. Whether the device is created or not, the response from the call appears to be the same, not generating anything in response.errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus: needs triageThis issue is awaiting triage by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions