Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Don't crash in populate when blockdev plugins are missing. #686

Open
wants to merge 2 commits into
base: 3.1-devel
Choose a base branch
from

Conversation

dwlehman
Copy link
Contributor

This was thrown together as quickly as possible on Friday to see what it would take. Now I need to decide how to organize things for a final/real version. Using the existing availability tasks from the device classes is somewhat heavy-handed since we only need query functionality for populating the devicetree, so I am considering creating some new functions in devicelibs that call BlockDev.foo_is_tech_avail() to determine which functionality is available at runtime.

@vpodzime
Copy link
Contributor

I'd suggest using the DependencyGuard instances as decorators of the populator methods. Similarly to how iSCSIDependencyGuard is used in the iscsi code

@dwlehman dwlehman force-pushed the populate-no-plugins branch 2 times, most recently from b05ee9a to 9d0bc2c Compare May 1, 2018 19:47
@dwlehman
Copy link
Contributor Author

dwlehman commented May 1, 2018

One thing still needed is to make it clear that these guards are only for query/populate as opposed to being general-purpose.

@vpodzime
Copy link
Contributor

vpodzime commented May 2, 2018

Nice, I really like this!

@vpodzime
Copy link
Contributor

vpodzime commented May 2, 2018

One thing still needed is to make it clear that these guards are only for query/populate as opposed to being general-purpose.

Yeah. Maybe there could be a new EvalMode like in_populate checking something like self.__class__._is_populate_guard with just these special new classes having that set to True?

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