Skip to content

Commit

Permalink
Fixed ansible.utils.ipaddr('host/prefix') function if size of ip's in…
Browse files Browse the repository at this point in the history
… subnet is 1.

Fixed ansible.utils.ipaddr('host/prefix') function if size of ip's in subnet is 1.
  • Loading branch information
ijajmulani authored Sep 11, 2024
1 parent 04eec0b commit 21d0d8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/plugin_utils/base/ipaddr_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def _ip_query(v):


def _address_prefix_query(v):
if v.ip in (v.network, v.broadcast):
if v.size == 1:
return False
if v.size > 2 and v.ip in (v.network, v.broadcast):
return False
return str(v.ip) + "/" + str(v.prefixlen)

Expand Down

0 comments on commit 21d0d8a

Please sign in to comment.