Helper: don't allow get/set config callers to access config options that they didn't declare in their schema.
(self, key: str)
| 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, |
no test coverage detected