def explode_hostgroup(self, svc_dep, hostgroups):
        snames = [d.strip() for d in svc_dep.service_description.split(',')]
        dep_snames = [d.strip() for d in svc_dep.dependent_service_description.split(',')]
        hg_names = [n.strip() for n in svc_dep.hostgroup_name.split(',')]
        for hg_name in hg_names:
            hostgroup = hostgroups.find_by_name(hg_name)
            if hostgroup is None:
                err = "ERROR: the servicedependecy got an unknown hostgroup_name '%s'" % hg_name
                self.add_error(err)
                continue
            hnames = []
            hnames.extend([m.strip() for m in hostgroup.get_hosts()])
            for hname in hnames:
                for dep_sname in dep_snames:
                    for sname in snames:
                        new_sd = svc_dep.copy()
                        new_sd.host_name = hname
                        new_sd.service_description = sname
                        new_sd.dependent_host_name = hname
                        new_sd.dependent_service_description = dep_sname
                        self.add_item(new_sd)