Skip to content

fix config unavailability for a device without data_source - #207

Closed
SAY-5 wants to merge 1 commit into
amyasnikov:masterfrom
SAY-5:fix-device-config-without-datasource
Closed

fix config unavailability for a device without data_source#207
SAY-5 wants to merge 1 commit into
amyasnikov:masterfrom
SAY-5:fix-device-config-without-datasource

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 20, 2026

Copy link
Copy Markdown

Closes #206

_config_item already handled data_source being None, but not the attribute being missing entirely, which is what happens when a device is fetched directly (e.g. VDevice.objects.get(...) in the shell) without prefetch_datasource()/set_datasource(). The missing-attribute AttributeError has obj set to the device, so the existing guard re-raised it. Treat that case the same as data_source is None.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@amyasnikov

Copy link
Copy Markdown
Owner

Hey @SAY-5,
I appreciate your attempt to contribute to Validity, but can't accept this PR due to the following reasons:

  1. The suggested change does not fix the issue data_source not available for device when managing via shell #206. Following the steps from it, you'll get an exception anyway.
  2. I don't even think any code change is required to fix this issue, because running code in shell has never been an official way to interact with Validity. The reporter of the issue can achieve the desired behaviour by using the right queryset VDevice.objects.prefetch_datasource().prefetch_serializer().prefetch_poller()

If you still wish to contribute to this project, I'd suggest to focus on another open issue. You can leave a comment and ask to assign an issue to you before beginning your work.

@amyasnikov amyasnikov closed this Jul 26, 2026
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.

data_source not available for device when managing via shell

2 participants