def get_template_info_from_metadata_format_and_template(
    harvester_metadata_format, template):
    """Get template information from metadata format and template
    Args:
        harvester_metadata_format: Metadata format
        template: Related template

    Returns:
        Template information.

    """
    name = harvester_metadata_format.get_display_name()
    return_value = {'id': template.id if template is not None else '',
        'name': name, 'hash': harvester_metadata_format.hash}
    return return_value
