From: Shubha Jain Date: Wed, 29 Apr 2026 12:54:33 +0000 (+0530) Subject: python-common/service_spec: fix style in hostname normalization changes X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b8a4f8217bdee734d08d49534f95fcfd5314d2b4;p=ceph.git python-common/service_spec: fix style in hostname normalization changes Made-with: Cursor Signed-off-by: Shubha Jain --- diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index 4b092449bbea..cd01842931a2 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -33,7 +33,12 @@ from typing import ( import yaml -from ceph.deployment.hostspec import HostSpec, SpecValidationError, normalize_hostname, assert_valid_host +from ceph.deployment.hostspec import ( + HostSpec, + SpecValidationError, + normalize_hostname, + assert_valid_host, +) from ceph.deployment.utils import unwrap_ipv6, valid_addr, verify_non_negative_int from ceph.deployment.utils import verify_positive_int, verify_non_negative_number from ceph.deployment.utils import verify_boolean, verify_enum, verify_int @@ -365,10 +370,15 @@ class PlacementSpec(object): # To backpopulate the .hosts attribute when using labels or count # in the orchestrator backend. if all(isinstance(h, HostPlacementSpec) for h in hosts): - # All items are HostPlacementSpec → normalize directly + # All items are HostPlacementSpec, normalize directly. + host_specs = cast(List[HostPlacementSpec], hosts) self.hosts = [ - HostPlacementSpec(normalize_hostname(h.hostname), h.network, h.name) # type: ignore[union-attr] - for h in hosts + HostPlacementSpec( + normalize_hostname(h.hostname), + h.network, + h.name, + ) + for h in host_specs ] else: # Otherwise, parse from strings