From 416def1dbc886155cbccf308662d92fade3a6534 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 6 May 2026 20:37:56 -0400 Subject: [PATCH] Closes #22054: Remove backward compatibility shim for expand_ipaddress_pattern() Removes the deprecated `expand_ipaddress_pattern()` alias and the associated `__getattr__` compatibility hook that redirected callers to `expand_ipnetwork_pattern()`. Co-Authored-By: Claude Sonnet 4.6 --- netbox/utilities/forms/utils.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/netbox/utilities/forms/utils.py b/netbox/utilities/forms/utils.py index b40ffa77c..73814c9e4 100644 --- a/netbox/utilities/forms/utils.py +++ b/netbox/utilities/forms/utils.py @@ -1,5 +1,4 @@ import re -import warnings from django import forms from django.forms.models import fields_for_model @@ -295,15 +294,3 @@ def validate_csv(headers, fields, required_fields): for f in required_fields: if f not in headers: raise forms.ValidationError(_('Required column header "{header}" not found.').format(header=f)) - - -# TODO: Remove in NetBox v4.7.0 -def __getattr__(name): - if name == 'expand_ipaddress_pattern': - warnings.warn( - "expand_ipaddress_pattern() has been renamed to expand_ipnetwork_pattern(). " - "expand_ipaddress_pattern() will be removed in NetBox v4.7.0.", - DeprecationWarning, - ) - return expand_ipnetwork_pattern - raise AttributeError(f"module {__name__!r} has no attribute {name!r}")