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 <>
parent 77987d23
from dcim.choices import DeviceStatusChoices
from dcim.models import * from dcim.models import *
from ipam.models import * from ipam.models import *
from extras.reports import Report from extras.reports import Report
...@@ -32,13 +33,21 @@ class ArubaApNetworkIntegration(Report): ...@@ -32,13 +33,21 @@ class ArubaApNetworkIntegration(Report):
Manufacturer.objects.get(name="Aruba")) Manufacturer.objects.get(name="Aruba"))
) )
): ):
device = interface.device
if interface.connected_endpoint is None: 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:
"Missing uplink cable on inactive AP")
"Missing uplink cable, but device is planned")
continue continue
if not \ if not \
== "Access Switch": == "Access Switch":
self.log_warning(interface.device, self.log_warning(device,
"Uplink is not an access switch") "Uplink is not an access switch")
else: 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