'Explodes services from templates. All hosts holding the specified
templates are bound the service.
:param hosts:   The hosts container.
:type hosts:    shinken.objects.host.Hosts
:param service: The service to explode.
:type service:  Service'

def explode_services_from_templates(self, hosts, service):

    hname = getattr(service, 'host_name', None)
    if (not hname):
        return
    if is_complex_expr(hname):
        hnames = self.evaluate_hostgroup_expression(hname.strip(), hosts, hosts.templates, look_in='templates')
        for name in hnames:
            self._local_create_service(hosts, name, service)
    else:
        hnames = [n.strip() for n in hname.split(',') if n.strip()]
        for hname in hnames:
            for name in hosts.find_hosts_that_use_template(hname):
                self._local_create_service(hosts, name, service)
