]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cephadm: fix EndPoint to handle bracketed IPv6 addresses
authorRedouane Kachach <rkachach@ibm.com>
Wed, 25 Feb 2026 14:09:11 +0000 (15:09 +0100)
committerRedouane Kachach <rkachach@ibm.com>
Thu, 23 Apr 2026 13:34:38 +0000 (15:34 +0200)
commit3f6a702d2851466d1de818ea239eea671a491545
tree2fd12818a848072372629b0b6e7110e0ca8e65ec
parent23898a80a5f3b5db9833627be07b4119d0921cf1
cephadm: fix EndPoint to handle bracketed IPv6 addresses

EndPoint ctr fails to correctly handle IPv6 addresses passed with
surrounding brackets. In this case, ipaddress.ip_network() raises
a ValueError, which is silently swallowed by the except block, leaving
is_ipv4 = True. This causes __str__/__repr__ method to return a malformed
address like fd19:8:5::11:3300 instead of [fd19:8:5::11]:3300.

Normalize the self.ip field by stripping brackets on construction so
we always save and use the bare ip. repr/str methods take care of
appending the [] when needed.

Fixes: https://tracker.ceph.com/issues/75165 (original ticket)
Fixes: https://tracker.ceph.com/issues/75567 (backport ticket)
Signed-off-by: Redouane Kachach <rkachach@ibm.com>
(cherry picked from commit 25319e985ade01f566f00cf0fd6a550c6f1c9764)
src/cephadm/cephadmlib/net_utils.py
src/cephadm/tests/test_networks.py