vapor-ware / netbox-virtual-circuit-plugin

A plugin for NetBox that supports Virtual Circuit management
GNU General Public License v3.0
57 stars 19 forks source link

NetBox 3.2 support #69

Open ryanmerolle opened 2 years ago

ryanmerolle commented 2 years ago

NetBox 3.2.0 was just released and has a number of extension improvements.

Furthermore, a NetBox 3.2 plugin tutorial was released

v0tti commented 2 years ago

This plugin does not seem to work with NetBox 3.2 at all. I get an error while trying to run the migrations: ImportError: cannot import name 'BaseTable' from 'utilities.tables' (/opt/netbox-3.2.1/netbox/utilities/tables.py)

When trying to log in as the admin user I get prompted this error: 'netbox_virtual_circuit_plugin' is not a registered namespace inside 'plugins'

PieterL75 commented 2 years ago

Changes I made to make this at least load (I haven't tested the functionality) https://github.com/vapor-ware/netbox-virtual-circuit-plugin/blob/master/netbox_virtual_circuit_plugin/tables.py#L3 --> from netbox.tables import BaseTable, ToggleColumn

https://github.com/vapor-ware/netbox-virtual-circuit-plugin/blob/master/netbox_virtual_circuit_plugin/templates/netbox_virtual_circuit_plugin/virtual_circuit_list.html#L7 --> replace 'content_type.model_class' with 'model'

https://github.com/vapor-ware/netbox-virtual-circuit-plugin/blob/master/netbox_virtual_circuit_plugin/templates/netbox_virtual_circuit_plugin/virtual_circuit_list.html#L33 --> remove 'bg_class="primary" ' (should be replaced with a bg_color)

https://github.com/vapor-ware/netbox-virtual-circuit-plugin/blob/master/netbox_virtual_circuit_plugin/templates/netbox_virtual_circuit_plugin/virtual_circuit_vlan_list.html#L7 --> replace 'content_type.model_class' with 'model'

https://github.com/vapor-ware/netbox-virtual-circuit-plugin/blob/master/netbox_virtual_circuit_plugin/templates/netbox_virtual_circuit_plugin/virtual_circuit_vlan_list.html#L33 --> remove 'bg_class="primary" ' (should be replaced with a bg_color)

but more work to be done... /plugins/virtual-circuit/add/ throws

<class 'TypeError'>

'NoneType' object is not callable
salvadorb commented 2 years ago

It would be great to have support for version 3.24+

andrewm659 commented 2 years ago

Having issues with 3.3.1

[netbox@dcim001 netbox]$ source /opt/dcim/netbox/venv/bin/activate (venv) [netbox@dcim001 netbox]$ python3.8 manage.py migrate Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/core/management/__init__.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/core/management/base.py", line 414, in run_from_argv self.execute(*args, **cmd_options) File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/core/management/base.py", line 460, in execute output = self.handle(*args, **options) File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/core/management/base.py", line 98, in wrapped res = handle_func(*args, **kwargs) File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/core/management/commands/migrate.py", line 91, in handle self.check(databases=[database]) File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/core/management/base.py", line 487, in check all_issues = checks.run_checks( File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/core/checks/registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/core/checks/urls.py", line 14, in check_url_config return check_resolver(resolver) File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/core/checks/urls.py", line 24, in check_resolver return check_method() File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/urls/resolvers.py", line 480, in check for pattern in self.url_patterns: File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/utils/functional.py", line 49, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/urls/resolvers.py", line 696, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/utils/functional.py", line 49, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/django/urls/resolvers.py", line 689, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 843, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/opt/dcim/netbox-3.3.1/netbox/netbox/urls.py", line 9, in <module> from extras.plugins.urls import plugin_admin_patterns, plugin_patterns, plugin_api_patterns File "/opt/dcim/netbox-3.3.1/netbox/extras/plugins/urls.py", line 28, in <module> urlpatterns = import_object(f"{plugin_path}.urls.urlpatterns") File "/opt/dcim/netbox-3.3.1/netbox/extras/plugins/utils.py", line 31, in import_object spec.loader.exec_module(module) File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/netbox_virtual_circuit_plugin/urls.py", line 2, in <module> from . import views File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/netbox_virtual_circuit_plugin/views.py", line 9, in <module> from .tables import VirtualCircuitTable, VirtualCircuitVLANTable File "/opt/dcim/netbox-3.3.1/venv/lib64/python3.8/site-packages/netbox_virtual_circuit_plugin/tables.py", line 3, in <module> from utilities.tables import BaseTable, ToggleColumn ImportError: cannot import name 'BaseTable' from 'utilities.tables' (/opt/dcim/netbox-3.3.1/netbox/utilities/tables.py) (venv) [netbox@dcim001 netbox]$