def METHOD_NAME(self: SharedUtils) -> str | None:
    if self.mlag:
        if self.switch_data_node_group_nodes[0]["name"] == self.hostname:
            return "primary"
        elif self.switch_data_node_group_nodes[1]["name"] == self.hostname:
            return "secondary"
        raise AristaAvdError("Unable to detect MLAG role")
    return None