Skip to content

Fix read_only enforcement in __exit__ and guard devices access in rpc…#52

Merged
krihal merged 1 commit into
clicon:mainfrom
denniswa:no_devices_root_and_read_only
Apr 1, 2026
Merged

Fix read_only enforcement in __exit__ and guard devices access in rpc…#52
krihal merged 1 commit into
clicon:mainfrom
denniswa:no_devices_root_and_read_only

Conversation

@denniswa
Copy link
Copy Markdown
Contributor

@denniswa denniswa commented Apr 1, 2026

…_config_set

  • Skip edit-config and commit in exit when read_only=True instead of only logging and falling through to the write path
  • Guard config.devices access in rpc_config_set so xpaths that don't include devices (e.g. /services) don't crash with AttributeError
  • Add read_only guard to apply_template for consistency
  • Add tests for rpc_config_set with and without devices in config

…_config_set

- Skip edit-config and commit in __exit__ when read_only=True instead of
  only logging and falling through to the write path
- Guard config.devices access in rpc_config_set so xpaths that don't
  include devices (e.g. /services) don't crash with AttributeError
- Add read_only guard to apply_template for consistency
- Add tests for rpc_config_set with and without devices in config
@krihal krihal merged commit 65ebcad into clicon:main Apr 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants