Ejemplo n.º 1
0
def teardown_rds():
    logging.warn('Removing RDS instance')
    conn = RDSConnection()
    
    try:
        db_inst = conn.get_all_dbinstances(instance_id=DB_NAME)[0]
    except:
        logging.debug('There was no RDS instance with name %s' % DB_NAME)
        return
    
    conn.delete_dbinstance(db_inst.id, skip_final_snapshot=True)

    while True:
        try:
            conn.get_all_dbinstances(instance_id=DB_NAME)[0]
        except:
            break
        else:
            time.sleep(30)
            logging.debug('Waiting...') 
    
    try:
        conn.delete_dbsecurity_group(SG_NAME)
    except:
        logging.debug('No DB security group %s to delete' % SG_NAME)
Ejemplo n.º 2
0
def teardown_rds():
    logging.warn('Removing RDS instance')
    conn = RDSConnection()

    try:
        db_inst = conn.get_all_dbinstances(instance_id=DB_NAME)[0]
    except:
        logging.debug('There was no RDS instance with name %s' % DB_NAME)
        return

    conn.delete_dbinstance(db_inst.id, skip_final_snapshot=True)

    while True:
        try:
            conn.get_all_dbinstances(instance_id=DB_NAME)[0]
        except:
            break
        else:
            time.sleep(30)
            logging.debug('Waiting...')

    try:
        conn.delete_dbsecurity_group(SG_NAME)
    except:
        logging.debug('No DB security group %s to delete' % SG_NAME)