From 4708708997379cbacd35ccc116124242217dad22 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Fri, 22 Nov 2024 13:41:19 +0100 Subject: [PATCH] Remove unused variables --- python/nav/bin/navdump.py | 4 ---- python/nav/web/seeddb/page/management_profile/__init__.py | 1 - python/nav/web/seeddb/page/netbox/edit.py | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/python/nav/bin/navdump.py b/python/nav/bin/navdump.py index bdf28caf21..2e0af46ee7 100755 --- a/python/nav/bin/navdump.py +++ b/python/nav/bin/navdump.py @@ -172,10 +172,6 @@ def management_profile(): """Outputs a line for each management profile in the database""" header("#name:protocol:option=value|option=value...") for profile in manage.ManagementProfile.objects.all(): - configuration = [ - '{}={}'.format(key, value) - for key, value in profile.configuration.items() - ] line = [ profile.name, profile.get_protocol_display(), diff --git a/python/nav/web/seeddb/page/management_profile/__init__.py b/python/nav/web/seeddb/page/management_profile/__init__.py index 6dd5948854..943f62c956 100644 --- a/python/nav/web/seeddb/page/management_profile/__init__.py +++ b/python/nav/web/seeddb/page/management_profile/__init__.py @@ -91,7 +91,6 @@ def management_profile_list(request): management_profile()""" info = ManagementProfileInfo() value_list = ('name', 'description', 'get_protocol_display', 'related') - netbox_link = reverse('seeddb-netbox') queryset = ManagementProfile.objects.annotate(related=Count('netboxes')) filter_form = ManagementProfileFilterForm(request.GET) return render_list( diff --git a/python/nav/web/seeddb/page/netbox/edit.py b/python/nav/web/seeddb/page/netbox/edit.py index 2e7d105566..d83bc4a809 100644 --- a/python/nav/web/seeddb/page/netbox/edit.py +++ b/python/nav/web/seeddb/page/netbox/edit.py @@ -230,7 +230,7 @@ def check_snmp_version(ip, profile): def test_napalm_connectivity(ip_address: str, profile: ManagementProfile) -> dict: """Tests connectivity of a NAPALM profile and returns a status dictionary""" try: - with napalm.connect(ip_address, profile) as device: + with napalm.connect(ip_address, profile): return {"status": True} except Exception as error: _logger.exception("Could not connect to %s using NAPALM profile", ip_address)