mirror of
https://github.com/ceph/ceph
synced 2025-03-22 02:08:13 +00:00
Merge pull request #39857 from adk3798/dup-labels
mgr/cephadm: remove duplicate labels when adding a host Reviewed-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com> Reviewed-by: Michael Fritch <mfritch@suse.com> Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
This commit is contained in:
commit
515feee667
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user