From 9efd4faea1320a8e037ef0e4a7deab89fb3a95ab Mon Sep 17 00:00:00 2001 From: Ivan Schaller Date: Fri, 9 Aug 2024 10:59:15 +0200 Subject: [PATCH] run auto-formatter Signed-off-by: Ivan Schaller --- src/octodns_netbox_dns/__init__.py | 7 +++---- tests/test_make_absolute.py | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/octodns_netbox_dns/__init__.py b/src/octodns_netbox_dns/__init__.py index b660b60..2aaf356 100644 --- a/src/octodns_netbox_dns/__init__.py +++ b/src/octodns_netbox_dns/__init__.py @@ -75,11 +75,10 @@ class NetBoxDNSProvider(octodns.provider.base.BaseProvider): self.make_absolute = make_absolute self.disable_ptr = disable_ptr - def _make_absolute(self, value: str, force : bool = False) -> str: + def _make_absolute(self, value: str, force: bool = False) -> str: """return dns name with trailing dot to make it absolute @param value: dns record value - @param force: when `True`, disregard configuration option `make_absolute` @return: absolute dns record value @@ -443,6 +442,6 @@ class NetBoxDNSProvider(octodns.provider.base.BaseProvider): """ query_params = {"status": "active", **self.nb_view} zones = self.api.plugins.netbox_dns.zones.filter(**query_params) - zones = [self._make_absolute(z.name, True) for z in zones] + absolute_zones = [self._make_absolute(z.name, True) for z in zones] - return sorted(zones) + return sorted(absolute_zones) diff --git a/tests/test_make_absolute.py b/tests/test_make_absolute.py index 39a7a3a..f099939 100644 --- a/tests/test_make_absolute.py +++ b/tests/test_make_absolute.py @@ -26,6 +26,7 @@ def test_noop(): assert absolute == "example.com." + def test_disabled(): args = {**DEFAULT_CONFIG, "make_absolute": False} nbdns = NetBoxDNSProvider(**args) @@ -34,10 +35,11 @@ def test_disabled(): assert relative == "example.com" + def test_force(): args = {**DEFAULT_CONFIG, "make_absolute": False} nbdns = NetBoxDNSProvider(**args) rcd = "example.com" absolute = nbdns._make_absolute(rcd, force=True) - assert absolute == "example.com." \ No newline at end of file + assert absolute == "example.com."