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

generator/generic-host: Handle missing configured platform

Sometimes, hosts don't have a platform configured in NetBox. This commit
handles this case properly by assuming those devices are not Linux
devices.
parent a6034333
......@@ -219,12 +219,13 @@ def create_icinga2_host_object_from_netbox(netbox, device_name):
continue
ssh_ports.append(p)
device_platform = device.platform.slug
device_is_linux = False
for linux_platform in LINUX_PLATFORMS:
if device_platform == linux_platform:
device_is_linux = True
break
if device.platform:
device_platform = device.platform.slug
for linux_platform in LINUX_PLATFORMS:
if device_platform == linux_platform:
device_is_linux = True
break
if device_is_linux:
host = Icinga2Host(
......
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