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

Version 2.11 compatibility #3

Closed
cautious-duck opened this issue Apr 19, 2021 · 7 comments
Closed

Version 2.11 compatibility #3

cautious-duck opened this issue Apr 19, 2021 · 7 comments

Comments

@cautious-duck
Copy link

phonebox_plugin fails to migrate to Netbox version 2.11.0.

Applying database migrations (python3 netbox/manage.py migrate)...
Traceback (most recent call last):
File "netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox-2.11.0/venv/lib/python3.7/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
utility.execute()
File "/opt/netbox-2.11.0/venv/lib/python3.7/site-packages/django/core/management/init.py", line 395, in execute
django.setup()
File "/opt/netbox-2.11.0/venv/lib/python3.7/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/opt/netbox-2.11.0/venv/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/opt/netbox-2.11.0/venv/lib/python3.7/site-packages/django/apps/config.py", line 301, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/opt/netbox-2.11.0/venv/lib/python3.7/site-packages/phonebox_plugin/models.py", line 2, in
from extras.models import ChangeLoggedModel, TaggedItem
ImportError: cannot import name 'ChangeLoggedModel' from 'extras.models' (/opt/netbox-2.11.0/netbox/extras/models/init.py)

@uc33260
Copy link

uc33260 commented May 5, 2021

I have the same issue after installing Netbox v2.11.

Unable to run these commands:

(venv) $ python3 manage.py migrate

(venv) $ python3 manage.py collectstatic

and I have to comment the plugin part in configuration.py otherwise nginx does not launch the Netbox web page

@iDebugAll
Copy link
Owner

iDebugAll commented May 5, 2021

Thank you for your feedback and interest to the plugin.
I've just published a new release to allow the plugin for NetBox 2.11+.
In my test NB 2.11.2 environment, all general test cases work without crashes.
Please try to upgrade the plugin. I will leave the issue opened for additional feedback for a while.

@uc33260
Copy link

uc33260 commented May 5, 2021 via email

@iDebugAll
Copy link
Owner

@uc33260
This is already merged into the main branch here and published on PyPi.
Usual upgrade and install guidelines are relevant.

@uc33260
Copy link

uc33260 commented May 6, 2021

I upgraded to the new release, that's working fine now !
Thank you.

Does new features are scheduled for this plugin ? two features will be helpful to add:

Bulk add like for IP Address

Appearance in Tenant "Stats" dashboard to visualize the number of DID/internal numbers added for a tenant.

@iDebugAll
Copy link
Owner

@uc33260

Does new features are scheduled for this plugin ?

Yes, I'm planning some enhancements for the plugin, including some relations between Numbers, Devices, and Voice Circuits.
Probably some IPAM Prefix analog for Numbers would also be helpful.
Feel free to open the issue marked as [Feature Request] if you have some ideas and use cases that might be interesting to the community.

Bulk add like for IP Address

This is already implemented. There is an 'Import' button in the right top corner of the Numbers page.
It leads to /plugins/phonebox/import_numbers/ page with a CSV bulk import form of a similar format.

Appearance in Tenant "Stats" dashboard to visualize the number of DID/internal numbers added for a tenant.

This ability might be limited from the plugins code. They do allow to extend some of the NetBox sections, but I should check if you can do this for Tenants.

@atriumcarceri
Copy link

atriumcarceri commented May 28, 2021

Got that at migrate

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/core/management/base.py", line 89, in wrapped
    res = handle_func(*args, **kwargs)
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/core/management/commands/migrate.py", line 75, in handle
    self.check(databases=[database])
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/core/management/base.py", line 423, in check
    databases=databases,
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/core/checks/registry.py", line 76, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/core/checks/urls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/core/checks/urls.py", line 23, in check_resolver
    return check_method()
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/urls/resolvers.py", line 412, in check
    for pattern in self.url_patterns:
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/urls/resolvers.py", line 598, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/django/urls/resolvers.py", line 591, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/netbox-2.11.4/netbox/netbox/urls.py", line 8, in <module>
    from extras.plugins.urls import plugin_admin_patterns, plugin_patterns, plugin_api_patterns
  File "/opt/netbox-2.11.4/netbox/extras/plugins/urls.py", line 28, in <module>
    urlpatterns = import_object(f"{plugin_path}.urls.urlpatterns")
  File "/opt/netbox-2.11.4/netbox/extras/plugins/utils.py", line 31, in import_object
    spec.loader.exec_module(module)
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/phonebox_plugin/urls.py", line 2, in <module>
    from . import views
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/phonebox_plugin/views.py", line 5, in <module>
    from . import filters
  File "/opt/netbox-2.11.4/venv/lib/python3.7/site-packages/phonebox_plugin/filters.py", line 2, in <module>
    from utilities.filters import BaseFilterSet, TagFilter
ImportError: cannot import name 'BaseFilterSet' from 'utilities.filters' (/opt/netbox-2.11.4/netbox/utilities/filters.py)

Python version: 3.7.3
NetBox version: 2.11.4

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

No branches or pull requests

4 participants