Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a new cable on an already used interface (API) #10929

Closed
Etibru opened this issue Nov 16, 2022 · 0 comments
Closed

Create a new cable on an already used interface (API) #10929

Etibru opened this issue Nov 16, 2022 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@Etibru
Copy link

Etibru commented Nov 16, 2022

NetBox version

v3.3.7

Python version

3.9

Steps to Reproduce

  1. Create a cable between 2 blank interfaces
    Using api to create a cable (/api/dcim/cables/)
data_cable = {
        "a_terminations": [
            {
                "object_type": "dcim.interface",
                "object_id": 31,
            },
        ],
        "b_terminations": [
            {
                "object_type": "dcim.interface",
                "object_id": 59,
            },
        ],
        "status": "connected",
    }

OK
2. Repeat with the same interface for B and another one for A

data_cable = {
        "a_terminations": [
            {
                "object_type": "dcim.interface",
                "object_id": 32,
            },
        ],
        "b_terminations": [
            {
                "object_type": "dcim.interface",
                "object_id": 59,
            },
        ],
        "status": "connected",
    }
  1. Error 500

Expected Behavior

Note the fact that the interface is already in use

Observed Behavior

django.db.utils.IntegrityError: duplicate key value violates unique constraint "dcim_cable_termination_unique_termination" DETAIL: Key (termination_type_id, termination_id)=(32, 59) already exists.

@Etibru Etibru added the type: bug A confirmed report of unexpected behavior in the application label Nov 16, 2022
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Nov 18, 2022
@jeremystretch jeremystretch self-assigned this Nov 21, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants