Verified Commit d2a355c1 authored by Adrian Schollmeyer's avatar Adrian Schollmeyer
Browse files

aruba: Send different log status for missing cabling on planned/inactive APs



Signed-off-by: Adrian Schollmeyer's avatarAdrian 'nex' Schollmeyer <adrian.schollmeyer@fem.tu-ilmenau.de>
parent 77987d23
from dcim.choices import DeviceStatusChoices
from dcim.models import *
from ipam.models import *
from extras.reports import Report
......@@ -32,13 +33,21 @@ class ArubaApNetworkIntegration(Report):
Manufacturer.objects.get(name="Aruba"))
)
):
device = interface.device
if interface.connected_endpoint is None:
self.log_failure(interface.device, "Missing uplink cable")
if device.status == DeviceStatusChoices.STATUS_ACTIVE:
self.log_failure(device, "Missing uplink cable")
elif not device.status == DeviceStatusChoices.STATUS_PLANNED:
self.log_warning(device,
"Missing uplink cable on inactive AP")
else:
self.log_info(device,
"Missing uplink cable, but device is planned")
continue
if not interface.connected_endpoint.device.device_role.name \
== "Access Switch":
self.log_warning(interface.device,
self.log_warning(device,
"Uplink is not an access switch")
else:
self.log_success(interface.device)
self.log_success(device)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment