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

Method _validate_module_option

src/pybind/mgr/mgr_module.py:2115–2123  ·  view source on GitHub ↗

Helper: don't allow get/set config callers to access config options that they didn't declare in their schema.

(self, key: str)

Source from the content-addressed store, hash-verified

2113 return self._ceph_get_foreign_option(entity, key)
2114
2115 def _validate_module_option(self, key: str) -> None:
2116 """
2117 Helper: don't allow get/set config callers to
2118 access config options that they didn't declare
2119 in their schema.
2120 """
2121 if key not in [o['name'] for o in self.MODULE_OPTIONS]: # type: ignore[attr-defined]
2122 raise RuntimeError("Config option '{0}' is not in {1}.MODULE_OPTIONS".
2123 format(key, self.__class__.__name__))
2124
2125 def _get_module_option(self,
2126 key: str,

Callers 6

get_module_optionMethod · 0.95
get_module_option_exMethod · 0.95
set_module_optionMethod · 0.95
set_module_option_exMethod · 0.95

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected