]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: remove duplicate labels when adding a host
authorAdam King <adking@redhat.com>
Fri, 5 Mar 2021 15:10:25 +0000 (10:10 -0500)
committerSage Weil <sage@newdream.net>
Tue, 16 Mar 2021 12:56:19 +0000 (07:56 -0500)
Fixes: https://tracker.ceph.com/issues/49626
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 030fb9d30fbd0b6914ee1ec8283fe7618ed1b8a5)

src/python-common/ceph/deployment/hostspec.py

index 714b8536e4eb5057ea11146cb1e5643af4ed8dc5..f15272d5f37e675258ce3e267dd582a02362b39c 100644 (file)
@@ -32,7 +32,7 @@ class HostSpec(object):
         return {
             'hostname': self.hostname,
             'addr': self.addr,
-            'labels': self.labels,
+            'labels': list(set((self.labels))),
             'status': self.status,
         }
 
@@ -40,7 +40,7 @@ class HostSpec(object):
     def from_json(cls, host_spec: dict) -> 'HostSpec':
         _cls = cls(host_spec['hostname'],
                    host_spec['addr'] if 'addr' in host_spec else None,
-                   host_spec['labels'] if 'labels' in host_spec else None,
+                   list(set(host_spec['labels'])) if 'labels' in host_spec else None,
                    host_spec['status'] if 'status' in host_spec else None)
         return _cls