示例#1
0
def bootstrap_host(hostname):
    if hostname not in _host_db:
        logging.info("Host %s could not be bootstrapped" % hostname)
        return False

    cdn_id, uses_ssl = _host_db[hostname]

    try:
        cdn = CDN.get(id=cdn_id)
    except CDN.DoesNotExist:
        bootstrap_cdn(cdn_id)
        cdn = CDN.get(id=cdn_id)

    Host.create(url=hostname, cdn=cdn, ssl=uses_ssl)

    return True