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

netbox_cable: Fix idempotency #990

Merged
merged 1 commit into from May 8, 2023

Conversation

jof
Copy link
Contributor

@jof jof commented Apr 27, 2023

Fixes #989

Related Issue

#989

New Behavior

netbox_cable module runs cleanly against Netbox v3.4.8 when pointing to a Rear Port, even after having already created the matching cable in a previous invocation of the module.

Subsequent runs show no changes.

Contrast to Current Behavior

Currently, running netbox_cable once works fine attaching to a Rear Port once, but some canonicalization inside of the module seems to break with the name of the /dcim/rear-ports API endpoint on modern Netbox.

Discussion: Benefits and Drawbacks

Benefit: the module works as intended

Drawback: I'm a relative newbie to these modules, and I'm not sure if my modifications of these data structures are proper.
Can I put kebab-case strings in there? Most seem to be snake_case?
Maybe something should be normalizing the endpoint name from kebab-case to snake_case in the representation of an existing cable termination before looking up in these structures?

Changes to the Documentation

None applicable; interfaces remain the same

Proposed Release Note Entry

Idempotency of Netbox Cables connected to Rear Ports works as expected

Double Check

  • I have read the comments and followed the CONTRIBUTING.md.
  • I have explained my PR according to the information in the comments or in a linked issue.
  • My PR targets the devel branch.

@jof jof force-pushed the jof/cables_idempotency branch from 726fcbb to c491c5e Compare May 7, 2023 02:20
@rodvand rodvand merged commit 6ffa244 into netbox-community:devel May 8, 2023
6 of 7 checks passed
rodvand pushed a commit to rodvand/ansible_modules that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Broken idempotency for netbox_cable module
3 participants