def get_host_password(host_id):
    """Return HOST_PASSWORD"""
    from physical.models import Host
    host = Host.objects.filter(id=host_id).select_related('cs_host_attributes')

    try:
        host = host[0]
    except __HOLE__ as e:
        LOG.warn("Host id does not exists: {}. {}".format(host_id, e))
        return None

    try:
        host_attr = host.cs_host_attributes.all()[0]
    except IndexError as e:
        LOG.warn(
            "Host id does not own a cs_host_attr: {}. {}".format(host_id, e))
        return None

    return host_attr.vm_password
dataset/ETHPy150Open globocom/database-as-a-service/dbaas/maintenance/registered_functions/functools.py/get_host_password