Went through NetBox 4.7's release notes for breaking/plugin-relevant changes and checked each one that could plausibly affect this plugin against the actual v4.7.1 source rather than assuming: - Rack.form_factor/width/airflow/outer_* are deprecated (removal planned for v5.0) but still present and behave the same - the plugin's GEOMETRY_FIELDS copying is unaffected. - ChoiceSet's CHOICES now accepts a new Choice object, but the metaclass explicitly still supports the legacy (value, label, color) tuple format this plugin's own choices.py uses - confirmed by reading utilities/choices.py's updated register() logic directly. - register_model_view, ViewTab, get_model_urls, PluginConfig's relative resource-path resolution, PortTemplateMapping/ PortMappingBase (patch panel front/rear sync), Cable/CableTermination/CabledObjectModel (rack-import cable copy), NetBoxModel/NetBoxModelForm/NetBoxModelFilterSet/NetBoxModelViewSet, PluginMenu*, ColorField, DynamicModelChoiceField, TagFilterField, CSVChoiceField/CSVModelChoiceField: all unchanged or only gained additive mixins. - django-tables2 v3's removed RelatedLinkColumn and the removed querystring tag aren't used anywhere in this plugin. The MPTT->ltree migration doesn't touch any model this plugin manipulates directly. No source changes were required. Raised max_version from 4.6.99 to 4.7.99 to reflect the verified range; left it there rather than guessing forward to an unreleased 4.8. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
55 lines
2.1 KiB
Python
55 lines
2.1 KiB
Python
from netbox.plugins import PluginConfig
|
|
|
|
__version__ = '0.2.4'
|
|
|
|
|
|
class RackConceptConfig(PluginConfig):
|
|
name = 'netbox_rack_concept'
|
|
verbose_name = 'NetBox Rack Concepts'
|
|
description = 'Rack blueprints: plan racks and their equipment without creating real racks or devices'
|
|
version = __version__
|
|
author = 'Claude'
|
|
base_url = 'rack-concepts'
|
|
min_version = '4.6.0'
|
|
# Verified against the real 4.7.1 source: RackBase/Rack fields, PortTemplateMapping,
|
|
# Cable/CableTermination, register_model_view/ViewTab, NetBoxModel*, ChoiceSet
|
|
# (its CHOICES refactor explicitly keeps supporting the legacy (value, label, color)
|
|
# tuple format this plugin uses) are all unchanged or additive. No 4.8 exists yet to
|
|
# verify against, so the ceiling stops at the 4.7 line rather than guessing further.
|
|
max_version = '4.7.99'
|
|
# These paths are relative to this module (NetBox prepends self.__module__),
|
|
# so they must NOT be prefixed with 'netbox_rack_concept.' again.
|
|
menu = 'navigation.menu'
|
|
template_extensions = 'template_content.template_extensions'
|
|
|
|
default_settings = {
|
|
# Defaults used when a concept is created from scratch.
|
|
'default_u_height': 42,
|
|
'default_width': 19,
|
|
|
|
# Show the "Copy to concept" button on the dcim.Rack detail page.
|
|
'enable_rack_tab': True,
|
|
|
|
# Status assigned to the objects created when a concept is deployed.
|
|
'deployed_rack_status': 'planned',
|
|
'deployed_device_status': 'planned',
|
|
|
|
# Mapping onto the partial-width implementation of netbox_utilities.
|
|
# Adjust these if that plugin renames its fields; set 'enabled' to False
|
|
# to never write partial-width data during deployment.
|
|
'partial_width': {
|
|
'enabled': True,
|
|
'model': 'netbox_utilities.RackDevicePosition',
|
|
'device_field': 'device',
|
|
'fraction_field': 'width_fraction',
|
|
'position_field': 'horizontal_position',
|
|
},
|
|
}
|
|
|
|
def ready(self):
|
|
super().ready()
|
|
from . import search # noqa: F401
|
|
|
|
|
|
config = RackConceptConfig
|