From ac356dd2f063156bce120d7419bb39c69247a8e9 Mon Sep 17 00:00:00 2001 From: Teoman ONAY Date: Mon, 3 Jul 2023 16:00:20 +0200 Subject: [PATCH] ceph orch add fails when ipv6 address is surrounded by square brackets. fixes: https://tracker.ceph.com/issues/61885 fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2153448 Signed-off-by: Teoman ONAY (cherry picked from commit 1ea71bee6197ed0357b586498a43d9d726160a43) --- src/pybind/mgr/orchestrator/module.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index a4ca7704f04..ffaaa4b0de6 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -19,6 +19,7 @@ from ceph.deployment.inventory import Device # noqa: F401; pylint: disable=unus from ceph.deployment.drive_group import DriveGroupSpec, DeviceSelection, OSDMethod from ceph.deployment.service_spec import PlacementSpec, ServiceSpec, service_spec_allow_invalid_from_json, TracingSpec from ceph.deployment.hostspec import SpecValidationError +from ceph.deployment.utils import unwrap_ipv6 from ceph.utils import datetime_now from mgr_util import to_pretty_timedelta, format_bytes @@ -466,6 +467,9 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule, if labels and len(labels) == 1: labels = labels[0].split(',') + if addr is not None: + addr = unwrap_ipv6(addr) + s = HostSpec(hostname=hostname, addr=addr, labels=labels, status=_status) return self._apply_misc([s], False, Format.plain) -- 2.39.5