def update_bnp_phys_switch_access_params(context, switch_id, params):
"""Update physical switch with access params."""
try:
with context.session.begin(subtransactions=True):
(context.session.query(models.BNPPhysicalSwitch).filter_by(
id=switch_id).update(
{'access_protocol': params['access_protocol'],
'write_community': params['write_community'],
'security_name': params['security_name'],
'auth_protocol': params['auth_protocol'],
'auth_key': params['auth_key'],
'priv_protocol': params['priv_protocol'],
'priv_key': params['priv_key'],
'security_level': params['security_level']},
synchronize_session=False))
except exc.NoResultFound:
LOG.error(_LE("no physical switch found for id: %s"), switch_id)
评论列表
文章目录