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

add cable trace (pathing) for front-ports and rear-ports #440

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcelb98
Copy link

The Netbox API has no /trace endpoint for front-ports and rear-ports, but a /paths endpoint (see issue #434).
This PR implements the /paths endpoint for pynetbox.

@srfwx
Copy link
Contributor

srfwx commented Jul 30, 2022

Hi,
I've tested your code. It doesn't work for me when tracing an open path.
I think a condition is missing in case there is no origin/destination port.

origin_endpoint = "/".join(
                    urlsplit(origin["url"])
                        .path[len(urlsplit(self.api.base_url).path):]
                        .split("/")[1:3]
                ) if origin else None
destination_endpoint = "/".join(
               urlsplit(destination["url"])
                   .path[len(urlsplit(self.api.base_url).path):]
                   .split("/")[1:3]
           ) if destination else None

Copy link
Member

@abhi1693 abhi1693 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide a test case for this

@arthanson
Copy link
Collaborator

@marcelb98 can you please provide a test case for this?

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.

4 participants