after_install.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:core-python 作者: yidao620c 项目源码 文件源码
def clear_static_routes(host, port, user, passwd):
    # --------------????????----------------------
    con = None
    try:
        con = psycopg2.connect(database='cloud_controller', user=user,
                               password=passwd, host=host, port=port)
        cur = con.cursor()
        cur.execute('delete from static_routes')
        con.commit()

    except psycopg2.DatabaseError as e:
        if con:
            con.rollback()
        print('Error is %s' % e)
    finally:
        if con:
            con.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号