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

Method normalize_json

src/python-common/ceph/deployment/service_spec.py:1162–1171  ·  view source on GitHub ↗
(json_spec: dict)

Source from the content-addressed store, hash-verified

1160
1161 @staticmethod
1162 def normalize_json(json_spec: dict) -> dict:
1163 networks = json_spec.get('networks')
1164 if networks is None:
1165 return json_spec
1166 if isinstance(networks, list):
1167 return json_spec
1168 if not isinstance(networks, str):
1169 raise SpecValidationError(f'Networks ({networks}) must be a string or list of strings')
1170 json_spec['networks'] = [networks]
1171 return json_spec
1172
1173 @classmethod
1174 def _from_json_impl(cls: Type[ServiceSpecT], json_spec: dict) -> ServiceSpecT:

Callers 1

from_jsonMethod · 0.45

Calls 2

SpecValidationErrorClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected