'The method is trying to find id or name in item_list
The method searches item with id_or_name in list and returns it.
If there is more than one value or no values then it raises an
exception
:param id_or_name: resource id or name
:param resource_list: list of resources
:param resource_type_name: name of resource type that will be used
for exceptions
:raises EntityNotFound, NoUniqueMatch
:return: resource or generate an exception otherwise'

@staticmethod
def _find_resource_by_id_or_name(id_or_name, resource_list, resource_type_name):

    search_result_by_id = [res for res in resource_list if (res.id == id_or_name)]
    if search_result_by_id:
        return search_result_by_id[0]
    else:
        search_result_by_name = [res for res in resource_list if (res.name == id_or_name)]
        match_count = len(search_result_by_name)
        if (match_count > 1):
            message = "Ambiguous    {0}    name    '{1}'.    Found    more    than    one    {0}    for    this    name    in    Manila.".format(resource_type_name, id_or_name)
            raise exceptions.NoUniqueMatch(message)
        elif (match_count == 1):
            return search_result_by_name[0]
        else:
            raise heat_exception.EntityNotFound(entity=resource_type_name, name=id_or_name)
