Skip to content

Commit

Permalink
Merge pull request #325 from raddessi/master.tracing-fix
Browse files Browse the repository at this point in the history
Fix for interface tracing
  • Loading branch information
Zach Moody authored Apr 5, 2021
2 parents 6016d97 + 881c01a commit 05fef9d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pynetbox/models/dcim.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ def trace(self):
this_hop_ret.append(hop_item_data)
continue

# the url for this item will be something like:
# https://netbox/api/dcim/rear-ports/12761/
# TODO: Move this to a more general function.
app_endpoint = "/".join(
urlsplit(hop_item_data["url"][len(self.api.base_url) :]).path.split(
"/"
)[1:3]
urlsplit(hop_item_data["url"])
.path[len(urlsplit(self.api.base_url).path) :]
.split("/")[1:3]
)

return_obj_class = uri_to_obj_class_map.get(app_endpoint, Record,)

this_hop_ret.append(
return_obj_class(hop_item_data, self.endpoint.api, self.endpoint)
)
Expand Down Expand Up @@ -162,11 +162,11 @@ class RUs(Record):
device = Devices


class FrontPorts(Record):
class FrontPorts(TraceableRecord):
device = Devices


class RearPorts(Record):
class RearPorts(TraceableRecord):
device = Devices


Expand Down

0 comments on commit 05fef9d

Please sign in to comment.