示例#1
0
def run():
    dc = os.getenv("DC")
    print "Using datacenter", dc
    qname = dc + ":destroyq"
    q = redisq.Queue(qname, redis_shell, TIMEOUT)
    while True:
        name, remover = q.next_job()
        if name:
            print "Destroying", name
            vps_util.destroy_vps(name)
            remover()
        time.sleep(10)
示例#2
0
def run():
    qname = vps_util.my_cm() + ":destroyq"
    region = vps_util.my_region()
    q = redisq.Queue(qname, redis_shell, TIMEOUT)
    print "Starting destroy service in cloudmaster %s, region %s." % (vps_util.my_cm(), region)
    while True:
        name, remover = q.next_job()
        if name:
            if redis_shell.sismember(region + ":bakedin-names", name):
                print "Not retiring baked-in server", name
            else:
                print "Destroying", name
                vps_util.destroy_vps(name)
            remover()
        else:
            time.sleep(10)
示例#3
0
def run():
    qname = vps_util.my_cm() + ":destroyq"
    region = vps_util.my_region()
    q = redisq.Queue(qname, redis_shell, TIMEOUT)
    print "Starting destroy service in cloudmaster %s, region %s." % (
        vps_util.my_cm(), region)
    while True:
        name, remover = q.next_job()
        if name:
            if redis_shell.sismember(region + ":bakedin-names", name):
                print "Not retiring baked-in server", name
            else:
                print "Destroying", name
                vps_util.destroy_vps(name)
            remover()
        else:
            time.sleep(10)