mirror of
https://github.com/ceph/ceph
synced 2025-04-11 04:02:04 +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 {
|
return {
|
||||||
'hostname': self.hostname,
|
'hostname': self.hostname,
|
||||||
'addr': self.addr,
|
'addr': self.addr,
|
||||||
'labels': self.labels,
|
'labels': list(set((self.labels))),
|
||||||
'status': self.status,
|
'status': self.status,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ class HostSpec(object):
|
|||||||
def from_json(cls, host_spec: dict) -> 'HostSpec':
|
def from_json(cls, host_spec: dict) -> 'HostSpec':
|
||||||
_cls = cls(host_spec['hostname'],
|
_cls = cls(host_spec['hostname'],
|
||||||
host_spec['addr'] if 'addr' in host_spec else None,
|
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)
|
host_spec['status'] if 'status' in host_spec else None)
|
||||||
return _cls
|
return _cls
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user