Skip to content

Commit c5cf775

Browse files
poyyntKB-perByte
andauthored
fix in_network test (#429)
Co-authored-by: Sagar Paul <sagpaul@redhat.com>
1 parent f143c6e commit c5cf775

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

plugins/plugin_utils/base/ipaddress_utils.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,18 @@ def wrapper(*args, **kwargs):
6060
return wrapper
6161

6262

63+
def _get_network_version(network):
64+
"""
65+
Python 3.14 changes the _version attribute to version, so we have to try both.
66+
"""
67+
if hasattr(network, "_version"):
68+
return network._version
69+
return network.version
70+
71+
6372
def _is_subnet_of(network_a, network_b):
6473
try:
65-
if network_a._version != network_b._version:
74+
if _get_network_version(network_a) != _get_network_version(network_b):
6675
return False
6776
return (
6877
network_b.network_address <= network_a.network_address

0 commit comments

Comments
 (0)