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

Update utils.py force rack_u_position to string value. #195

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion netbox_prometheus_sd/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@ def extract_service_ports(obj, labels: LabelDict):
def extract_rack_u_poistion(obj, labels: LabelDict):
"""Extract rack U poistion"""
if hasattr(obj, "position") and obj.position:
labels["rack_u_position"] = obj.position
labels["rack_u_position"] = str(obj.position)
2 changes: 1 addition & 1 deletion netbox_prometheus_sd/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def build_device_full(name, ip_octet=1):
device.tags.add("Tag1")
device.tags.add("Tag 2")
device.save()
device.position = "1.0"
device.position = 1.0
Service.objects.create(device=device, name="ssh", protocol='tcp', ports=[22])
return device

Expand Down
Loading