Skip to content

Add code to track why a Resource is disabled#93

Draft
gcrone wants to merge 1 commit intodevelopfrom
gcrone/why_disabled
Draft

Add code to track why a Resource is disabled#93
gcrone wants to merge 1 commit intodevelopfrom
gcrone/why_disabled

Conversation

@gcrone
Copy link
Copy Markdown
Contributor

@gcrone gcrone commented Apr 15, 2026

Description

It is sometimes difficult to know why a Resource is disabled. This update adds a string member to the Resource class to store a reason and code to the DisabledResources class and individual ResourceSet implementations to store the reason.

Python bindings are provided to query why a Resource is disabled and to list all the Resources contained in a ResourceSet

>>> import conffwk
>>> import confmodel_dal
>>> db = conffwk.Configuration("oksconflibs:sessions/tde-testcrate.data.xml")
>>> confmodel_dal.why_disabled(db._obj,'tde-testcrate-session','runp02srv004tde-testcrate')
'all contained components disabled'
>>> confmodel_dal.why_disabled(db._obj,'tde-testcrate-session','tde-testcrate-segment')
'all contained segments/applications disabled'
>>> confmodel_dal.why_disabled(db._obj,'tde-testcrate-session','DetStream-302')
'child of disabled object dds-tde-amc-crate0-slot1, child of disabled object tde-connections-test-crate, receiver dpdk-np02srv004-receiver-3-tde disabled, child of disabled object tde-connections-crate-3-4-5-8-9, disabled in initial list'

Type of change

  • Documentation (non-breaking change that adds or improves the documentation)
  • New feature or enhancement (non-breaking change which adds functionality)
  • Optimization (non-breaking change that improves code/performance)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Testing checklist

  • Unit tests pass (e.g. dbt-build --unittest)
  • Minimal system quicktest passes (pytest -s minimal_system_quick_test.py)
  • Full set of integration tests pass (dunedaq_integtest_bundle.sh)
  • Python tests pass if applicable (e.g. python -m pytest)
  • Pre-commit hooks run successfully if applicable (e.g. pre-commit run --all-files)

Comments here on the testing

Further checks

  • Code is commented where needed, particularly in hard-to-understand areas
  • Code style is correct (dbt-build --lint, and/or see https://dune-daq-sw.readthedocs.io/en/latest/packages/styleguide/)
  • If applicable, new tests have been added or an issue has been opened to tackle that in the future.
    (Indicate issue here: # (issue))

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