From 09d091bcd7c877fb4d6efdf8cbbbb141ac17d2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ga=C3=9Fner?= Date: Wed, 29 Sep 2021 16:18:20 +0200 Subject: [PATCH] Fixed version comparing on conditional model import - allows NetBox 3 support --- netbox_metrics_ext/metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox_metrics_ext/metrics.py b/netbox_metrics_ext/metrics.py index 24b3cab..2b2eb9b 100644 --- a/netbox_metrics_ext/metrics.py +++ b/netbox_metrics_ext/metrics.py @@ -51,7 +51,7 @@ def metric_reports(): Iterator[GaugeMetricFamily] netbox_report_stats: with report module, name and status as labels """ - if netbox_version.major >= 2 and netbox_version.minor >= 9: + if netbox_version >= version.parse("2.9.0"): from django.contrib.contenttypes.models import ContentType # pylint: disable=import-outside-toplevel from extras.models import Report, JobResult # pylint: disable=import-outside-toplevel,no-name-in-module