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

Closes: #18535 - Skip incompatible plugins during startup and remove from PLUGINS #18537

Open
wants to merge 1 commit into
base: feature
Choose a base branch
from

Conversation

bctiemann
Copy link
Contributor

Closes: #18535

Changes the behavior of the PluginConfig.validate method so that if a plugin with incompatible min or max version specified, it raises an IncompatiblePluginError which is caught in settings.py and registering the plugin is skipped, allowing NetBox to launch cleanly with the plugin disabled.

try:
plugin_config.validate(PLUGINS_CONFIG[plugin_name], RELEASE.version)
except IncompatiblePluginError as e:
print(f'Unable to load plugin {plugin_name}: {e}')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about adding a print here, as it would be the first of its kind in this file. Is there a better way to emit this warning?

@a084ed22
Copy link

Just to understand, this would print a warning at netbox upgrade time? The experience of figuring out which plugin has a strict max_version specified and breaks the upgrade process even on patch upgrades during the database migration step could really use to be more explanatory.

@bctiemann
Copy link
Contributor Author

Yes, it would look like this:

Unable to load plugin netbox_branching: Plugin netbox_branching requires NetBox maximum version 4.2.1 (current: 4.2.2).
Watching for file changes with StatReloader
Performing system checks...

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