def get_hosts_for_database(database):
    hosts = []
    for host in Host.objects.filter(instance__databaseinfra=database.infra).distinct():
        if '.' in host.hostname:
            hosts.append(host.hostname.split('.')[0])
        else:
            hosts.append(host.hostname)
    return hosts
dataset/ETHPy150Open globocom/database-as-a-service/dbaas/util/laas.py/get_hosts_for_database/original