'Chooses a virtual host based on the given domain name.
If there is no clear virtual host to be selected, the user is prompted
with all available choices.
The returned vhost is guaranteed to have TLS enabled unless temp is
True. If temp is True, there is no such guarantee and the result is
not cached.
:param str target_name: domain name
:param bool temp: whether the vhost is only used temporarily
:returns: ssl vhost associated with name
:rtype: :class:`~certbot_apache.obj.VirtualHost`
:raises .errors.PluginError: If no vhost is available or chosen'

def choose_vhost(self, target_name, temp=False):

    if (target_name in self.assoc):
        return self.assoc[target_name]
    vhost = self._find_best_vhost(target_name)
    if (vhost is not None):
        if temp:
            return vhost
        if (not vhost.ssl):
            vhost = self.make_vhost_ssl(vhost)
        self._add_servername_alias(target_name, vhost)
        self.assoc[target_name] = vhost
        return vhost
    return self._choose_vhost_from_list(target_name, temp)
