def get_component_status(obj, module, component_name: str):
    """
    get_component_status returns a boolean to indicate if a certain component is enabled or disabled.
    obj can be either a dict of a MCH CR, or a dict of a MCE CR.
    If the component_name is not existed in the spec.components list, will return False.
    """
    if obj is None:
        return False
    obj_feature_path = ['spec', 'overrides', 'components']
    curr = obj
    for p in obj_feature_path:
        next = curr.get(p)
        if next is None:
            return False
        curr = next
    components = curr
    try:
        for component in components:
            if component.get('name', '') != component_name:
                continue
            return component.get('enabled', False)
    except (TypeError, AttributeError) as e:
        module.fail_json(
            msg=f'failed to get enablement status of component {component_name}: {e}', exception=e)

    return False