]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph orch add fails when ipv6 address is surrounded by square brackets. 53978/head
authorTeoman ONAY <tonay@ibm.com>
Mon, 3 Jul 2023 14:00:20 +0000 (16:00 +0200)
committerAdam King <adking@redhat.com>
Wed, 11 Oct 2023 18:26:17 +0000 (14:26 -0400)
fixes: https://tracker.ceph.com/issues/61885
fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2153448

Signed-off-by: Teoman ONAY <tonay@ibm.com>
(cherry picked from commit 1ea71bee6197ed0357b586498a43d9d726160a43)

src/pybind/mgr/orchestrator/module.py

index d6fe7a3bc6cdf02eca70e7aa4451924efb00d00c..fffb9250abc33d56eb7befb575bc099b308acf77 100644 (file)
@@ -12,6 +12,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
 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
@@ -349,6 +350,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)