Skip to content
Snippets Groups Projects

Add iBGP workflow and LibreNMS client

Merged Karel van Klink requested to merge feature/add-ibgp-workflow into develop
All threads resolved!
3 files
+ 468
8
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -98,12 +98,15 @@ class LibreNMSClient:
:return list[str]: A list of errors, if empty the device is successfully validated.
"""
errors = []
device = self.get_device(fqdn)
if device["status"] != "ok":
errors += ["Device does not exist in LibreNMS."]
try:
device = self.get_device(fqdn)
if device["hostname"] != fqdn:
errors += ["Device hostname in LibreNMS does not match FQDN."]
if device["devices"][0]["hostname"] != fqdn:
errors += ["Device hostname in LibreNMS does not match FQDN."]
except HTTPError as e:
if e.response.status_code == HTTPStatus.NOT_FOUND:
errors += ["Device does not exist in LibreNMS."]
else:
raise
return errors
Loading