different way to say 'all items okay'

This commit is contained in:
meejah 2023-02-28 10:43:49 -07:00
parent aed5061a96
commit b28ac6118b
2 changed files with 3 additions and 7 deletions

View File

@ -76,7 +76,8 @@ def _is_valid_section(section_name):
"""
return (
section_name.startswith("storageserver.plugins.") or
section_name.startswith("storageclient.plugins.")
section_name.startswith("storageclient.plugins.") or
section_name in ("grid_managers", "grid_manager_certificates")
)
@ -93,8 +94,6 @@ _client_config = configutil.ValidConfiguration(
"shares.total",
"storage.plugins",
),
"grid_managers": None, # means "any options valid"
"grid_manager_certificates": None,
"storage": (
"debug_discard",
"enabled",

View File

@ -170,11 +170,8 @@ class ValidConfiguration(object):
:return: True if the given section name, item_name pair is valid, False
otherwise.
"""
valid_items = self._static_valid_sections.get(section_name, ())
if valid_items is None:
return True
return (
item_name in valid_items or
item_name in self._static_valid_sections.get(section_name, ()) or
self._is_valid_item(section_name, item_name)
)