in src/modules/get_pcmk_properties_db.py [0:0]
def _get_resource_expected_value(self, resource_type, section, param_name, op_name=None):
"""
Get expected value for a given resource configuration parameter.
:param resource_type: The type of the resource.
:type resource_type: str
:param section: The section of the resource configuration.
:type section: str
:param param_name: The name of the configuration parameter.
:type param_name: str
:param op_name: The name of the operation (if applicable), defaults to None
:type op_name: str, optional
:return: The expected value for the resource configuration 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