Skip to content

Commit

Permalink
ceph orch add fails when ipv6 address is surrounded by square brackets.
Browse files Browse the repository at this point in the history
  • Loading branch information
asm0deuz committed Aug 31, 2023
1 parent 9051031 commit 1ea71be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pybind/mgr/orchestrator/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
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
Expand Down Expand Up @@ -466,6 +467,9 @@ def _add_host(self,
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)
Expand Down

0 comments on commit 1ea71be

Please sign in to comment.