mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 17:08:41 -06:00
Simplify plugin_config.validate syntax
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
parent
1d6a656d63
commit
92a5623016
@ -814,10 +814,8 @@ for plugin_name in PLUGINS:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Validate version compatibility and user-provided configuration settings and assign defaults
|
# Validate version compatibility and user-provided configuration settings and assign defaults
|
||||||
if plugin_name not in PLUGINS_CONFIG:
|
|
||||||
PLUGINS_CONFIG[plugin_name] = {}
|
|
||||||
try:
|
try:
|
||||||
plugin_config.validate(PLUGINS_CONFIG[plugin_name], RELEASE.version)
|
plugin_config.validate(PLUGINS_CONFIG.get(plugin_name, {}), RELEASE.version)
|
||||||
except IncompatiblePluginError as e:
|
except IncompatiblePluginError as e:
|
||||||
warnings.warn(f'Unable to load plugin {plugin_name}: {e}')
|
warnings.warn(f'Unable to load plugin {plugin_name}: {e}')
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user