MCPcopy Create free account
hub / github.com/ceph/ceph / from_json

Method from_json

src/python-common/ceph/deployment/hostspec.py:99–110  ·  view source on GitHub ↗
(cls, host_spec: dict)

Source from the content-addressed store, hash-verified

97
98 @classmethod
99 def from_json(cls, host_spec: dict) -> 'HostSpec':
100 host_spec = cls.normalize_json(host_spec)
101 _cls = cls(
102 host_spec['hostname'],
103 host_spec['addr'] if 'addr' in host_spec else None,
104 list(OrderedDict.fromkeys(
105 host_spec['labels'])) if 'labels' in host_spec else None,
106 host_spec['status'] if 'status' in host_spec else None,
107 host_spec.get('location'),
108 host_spec['oob'] if 'oob' in host_spec else None,
109 )
110 return _cls
111
112 @staticmethod
113 def normalize_json(host_spec: dict) -> dict:

Callers

nothing calls this directly

Calls 3

listFunction · 0.50
normalize_jsonMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected