bm_nw_provision_db.py 文件源码

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

项目:networking-hpe 作者: openstack 项目源码 文件源码
def update_bnp_snmp_cred_by_id(context, cred_id, creds):
    """Update snmp switch credentials."""
    try:
        with context.session.begin(subtransactions=True):
            (context.session.query(models.BNPSNMPCredential).filter_by(
             id=cred_id).update(
                {'name': creds['name'],
                 'protocol_type': creds['protocol_type'],
                 'write_community': creds['write_community'],
                 'security_name': creds['security_name'],
                 'auth_protocol': creds['auth_protocol'],
                 'auth_key': creds['auth_key'],
                 'priv_protocol': creds['priv_protocol'],
                 'priv_key': creds['priv_key'],
                 'security_level': creds['security_level']},
             synchronize_session=False))
    except exc.NoResultFound:
        LOG.error(_LE("no snmp switch credentials found for id: %s"), cred_id)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号