Skip to content

Allow skipping IncompatiblePluginError handler #21086

@alehaa

Description

@alehaa

NetBox version

v4.5.0

Feature type

Change to existing functionality

Proposed functionality

If a plugin fails to load, a warning is logged, and NetBox continues to start without that plugin. I propose adding an option (default: off) that causes NetBox to fail in these situations. For instance:

try:
    plugin_config.validate(PLUGINS_CONFIG[plugin_name], RELEASE.version)
except IncompatiblePluginError as e:
    if option_set:
        warnings.warn(f'Unable to load plugin {plugin_name}: {e}')
        continue
    raise

Use case

I’m utilizing a customized NetBox image derived from the official Docker image. Continuous integration and continuous deployment (CI/CD) processes ensure the image functions correctly before being deployed to production. By implementing this option, the CI can fail on issues related to loading a plugin instead of silently failing.

Database changes

None.

External dependencies

None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    netboxtype: featureIntroduction of new functionality to the application

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions