def expandhosts(hosts, config):
    """
    load config and expand host names
    """
    res = []
    for host in hosts:
        if host in config:
            expandedhosts = config[host].get('host', host)
        else:
            expandedhosts = [host]
        res += expandedhosts
    return res
