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)
评论列表
文章目录