Skip to content

Conversation

@jestabro
Copy link
Contributor

Change summary

N.B. this will require an update to point to vyos/vyconf#32 once that PR is merged.

Standardize VyconfSession instance lifetime management across its use in the various config modules.
In summary:

  • use weakref.finalize for reliable session teardown
  • op-mode instances are ephemeral: a new session on init; teardown with gc
  • config mode instances are persistent, with lifetime managed by CLI session, resp. ConfigSession
  • add request show_sessions to return list of dicts of internal session record data structure, for data tracking and proof of correctness

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

How to test / Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

The standalone script teardown-config-session.py is called on CLI
config-mode exit, to close the persistent vyconf config session. Instead
of injecting the config-mode env var into the external script to
indicate a non-ephemeral session, add keyword 'extant' to find existing
session.
pid is the more commonly passed argument, and this maintains consistency
with configsession arg use.
show_sessions returns a list of dicts of the internal session record
structure for each live session. As this call is itself mediated by a
session one can specify exclude_self=True, resp., exclude_other=True.
@jestabro jestabro self-assigned this Oct 23, 2025
@github-actions
Copy link

👍
No issues in PR Title / Commit Title

@github-actions
Copy link

CI integration 👍 passed!

Details

CI logs

  • CLI Smoketests (no interfaces) 👍 passed
  • CLI Smoketests VPP 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • Config tests VPP 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant