]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
python-common/service_spec: fix style in hostname normalization changes 66820/head
authorShubha Jain <SHUBHA.JAIN1@ibm.com>
Wed, 29 Apr 2026 12:54:33 +0000 (18:24 +0530)
committerShubha Jain <SHUBHA.JAIN1@ibm.com>
Wed, 29 Apr 2026 12:54:50 +0000 (18:24 +0530)
Made-with: Cursor
Signed-off-by: Shubha Jain <SHUBHA.JAIN1@ibm.com>
src/python-common/ceph/deployment/service_spec.py

index 4b092449bbea3b6f391b46f4a44f58e4c0f3e437..cd01842931a21c6094dae00b7a88dba36bfe68cf 100644 (file)
@@ -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