__main__.py 文件源码

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

项目:virt-backup 作者: Anthony25 项目源码 文件源码
def _get_auth_conn(config):
    def request_cred(credentials, user_data):
        for credential in credentials:
            if credential[0] == libvirt.VIR_CRED_AUTHNAME:
                credential[4] = config.get("username")
            elif credential[0] == libvirt.VIR_CRED_PASSPHRASE:
                credential[4] = config.get("password")
        return 0

    auth = [
        [libvirt.VIR_CRED_AUTHNAME, libvirt.VIR_CRED_PASSPHRASE],
        request_cred, None
    ]
    return libvirt.openAuth(config["uri"], auth, 0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号