'oVirt in version 4.1 doesn\'t support search by template+version_number,
so we need to list all templates with specific name and then iterate
throught it\'s version until we find the version we look for.'

def __get_template_with_version(self):

    template = None
    if self._module.params['template']:
        templates_service = self._connection.system_service().templates_service()
        templates = templates_service.list(search=('name=%s' % self._module.params['template']))
        if self._module.params['template_version']:
            templates = [t for t in templates if (t.version.version_number == self._module.params['template_version'])]
        if templates:
            template = templates[0]
    return template
