Skip to content

Commit 05fef9d

Browse files
author
Zach Moody
authored
Merge pull request #325 from raddessi/master.tracing-fix
Fix for interface tracing
2 parents 6016d97 + 881c01a commit 05fef9d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pynetbox/models/dcim.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ def trace(self):
4848
this_hop_ret.append(hop_item_data)
4949
continue
5050

51+
# the url for this item will be something like:
52+
# https://netbox/api/dcim/rear-ports/12761/
5153
# TODO: Move this to a more general function.
5254
app_endpoint = "/".join(
53-
urlsplit(hop_item_data["url"][len(self.api.base_url) :]).path.split(
54-
"/"
55-
)[1:3]
55+
urlsplit(hop_item_data["url"])
56+
.path[len(urlsplit(self.api.base_url).path) :]
57+
.split("/")[1:3]
5658
)
57-
5859
return_obj_class = uri_to_obj_class_map.get(app_endpoint, Record,)
59-
6060
this_hop_ret.append(
6161
return_obj_class(hop_item_data, self.endpoint.api, self.endpoint)
6262
)
@@ -162,11 +162,11 @@ class RUs(Record):
162162
device = Devices
163163

164164

165-
class FrontPorts(Record):
165+
class FrontPorts(TraceableRecord):
166166
device = Devices
167167

168168

169-
class RearPorts(Record):
169+
class RearPorts(TraceableRecord):
170170
device = Devices
171171

172172

0 commit comments

Comments
 (0)