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)