in src/modules/get_pcmk_properties_scs.py [0:0]
def _get_resource_expected_value(self, resource_type, section, param_name, op_name=None):
"""
Get expected value for resource-specific configuration parameters.
:param resource_type: Type of the resource (e.g., stonith, ipaddr)
:type resource_type: str
:param section: Section of the resource (e.g., meta_attributes, operations)
:type section: str
:param param_name: Name of the parameter
:type param_name: str
:param op_name: Name of the operation (if applicable)
:type op_name: str
:return: Expected value of the parameter
:rtype: str
"""
resource_defaults = (
self.constants["RESOURCE_DEFAULTS"].get(self.os_type, {}).get(resource_type, {})
)
if section == "meta_attributes":
return resource_defaults.get("meta_attributes", {}).get(param_name)
elif section == "operations":
ops = resource_defaults.get("operations", {}).get(op_name, {})
return ops.get(param_name)
elif section == "instance_attributes":
return resource_defaults.get("instance_attributes", {}).get(param_name)
return None