Skip to content

Instantly share code, notes, and snippets.

@dirtycajunrice
Created October 6, 2017 19:28
Show Gist options
  • Save dirtycajunrice/4c4e530912faff439b98b43ca8c7b49d to your computer and use it in GitHub Desktop.
Save dirtycajunrice/4c4e530912faff439b98b43ca8c7b49d to your computer and use it in GitHub Desktop.
root@netbox:/opt# ln -sfn netbox-2.1.5/ netbox
root@netbox:/opt# cd netbox
root@netbox:/opt/netbox# ./upgrade.sh
Running NetBox upgrade as root, press any key to continue or ^C to cancel
Cleaning up stale Python bytecode (find . -name "*.pyc" -delete)...
Updating required Python packages (pip3 install -r requirements.txt --upgrade)...
Requirement already up-to-date: cffi>=1.8 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 1))
Requirement already up-to-date: cryptography>=1.8 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 2))
Requirement already up-to-date: Django>=1.11 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 3))
Requirement already up-to-date: django-cors-headers>=2.0 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 4))
Requirement already up-to-date: django-debug-toolbar>=1.7 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 5))
Requirement already up-to-date: django-filter>=1.0.2 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 6))
Requirement already up-to-date: django-mptt==0.8.7 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 7))
Requirement already up-to-date: django-rest-swagger>=2.1.0 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 8))
Requirement already up-to-date: django-tables2>=1.7.0 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 9))
Collecting djangorestframework>=3.6.2 (from -r requirements.txt (line 10))
Using cached djangorestframework-3.7.0-py2.py3-none-any.whl
Requirement already up-to-date: graphviz>=0.6 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 11))
Requirement already up-to-date: Markdown>=2.6.7 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 12))
Requirement already up-to-date: natsort>=5.0.0 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 13))
Requirement already up-to-date: ncclient==0.5.3 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 14))
Requirement already up-to-date: netaddr==0.7.18 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 15))
Requirement already up-to-date: paramiko>=2.0.0 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 16))
Requirement already up-to-date: Pillow>=4.0.0 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 17))
Requirement already up-to-date: psycopg2>=2.6.1 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 18))
Requirement already up-to-date: py-gfm>=0.1.3 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 19))
Requirement already up-to-date: pycrypto>=2.6.1 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 20))
Requirement already up-to-date: sqlparse>=0.2 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 21))
Requirement already up-to-date: xmltodict>=0.10.2 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 22))
Requirement already up-to-date: pycparser in /usr/local/lib/python3.5/dist-packages (from cffi>=1.8->-r requirements.txt (line 1))
Requirement already up-to-date: asn1crypto>=0.21.0 in /usr/local/lib/python3.5/dist-packages (from cryptography>=1.8->-r requirements.txt (line 2))
Requirement already up-to-date: idna>=2.1 in /usr/local/lib/python3.5/dist-packages (from cryptography>=1.8->-r requirements.txt (line 2))
Requirement already up-to-date: six>=1.4.1 in /usr/local/lib/python3.5/dist-packages (from cryptography>=1.8->-r requirements.txt (line 2))
Requirement already up-to-date: pytz in /usr/local/lib/python3.5/dist-packages (from Django>=1.11->-r requirements.txt (line 3))
Requirement already up-to-date: openapi-codec>=1.3.1 in /usr/local/lib/python3.5/dist-packages (from django-rest-swagger>=2.1.0->-r requirements.txt (line 8))
Requirement already up-to-date: coreapi>=2.3.0 in /usr/local/lib/python3.5/dist-packages (from django-rest-swagger>=2.1.0->-r requirements.txt (line 8))
Requirement already up-to-date: simplejson in /usr/local/lib/python3.5/dist-packages (from django-rest-swagger>=2.1.0->-r requirements.txt (line 8))
Requirement already up-to-date: setuptools>0.6 in /usr/local/lib/python3.5/dist-packages (from ncclient==0.5.3->-r requirements.txt (line 14))
Requirement already up-to-date: lxml>=3.3.0 in /usr/local/lib/python3.5/dist-packages (from ncclient==0.5.3->-r requirements.txt (line 14))
Requirement already up-to-date: bcrypt>=3.1.3 in /usr/local/lib/python3.5/dist-packages (from paramiko>=2.0.0->-r requirements.txt (line 16))
Requirement already up-to-date: pyasn1>=0.1.7 in /usr/local/lib/python3.5/dist-packages (from paramiko>=2.0.0->-r requirements.txt (line 16))
Requirement already up-to-date: pynacl>=1.0.1 in /usr/local/lib/python3.5/dist-packages (from paramiko>=2.0.0->-r requirements.txt (line 16))
Requirement already up-to-date: olefile in /usr/local/lib/python3.5/dist-packages (from Pillow>=4.0.0->-r requirements.txt (line 17))
Requirement already up-to-date: uritemplate in /usr/local/lib/python3.5/dist-packages (from coreapi>=2.3.0->django-rest-swagger>=2.1.0->-r requirements.txt (line 8))
Requirement already up-to-date: requests in /usr/local/lib/python3.5/dist-packages (from coreapi>=2.3.0->django-rest-swagger>=2.1.0->-r requirements.txt (line 8))
Requirement already up-to-date: itypes in /usr/local/lib/python3.5/dist-packages (from coreapi>=2.3.0->django-rest-swagger>=2.1.0->-r requirements.txt (line 8))
Requirement already up-to-date: coreschema in /usr/local/lib/python3.5/dist-packages (from coreapi>=2.3.0->django-rest-swagger>=2.1.0->-r requirements.txt (line 8))
Requirement already up-to-date: certifi>=2017.4.17 in /usr/local/lib/python3.5/dist-packages (from requests->coreapi>=2.3.0->django-rest-swagger>=2.1.0->-r requirements.txt (line 8))
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.5/dist-packages (from requests->coreapi>=2.3.0->django-rest-swagger>=2.1.0->-r requirements.txt (line 8))
Requirement already up-to-date: urllib3<1.23,>=1.21.1 in /usr/local/lib/python3.5/dist-packages (from requests->coreapi>=2.3.0->django-rest-swagger>=2.1.0->-r requirements.txt (line 8))
Requirement already up-to-date: jinja2 in /usr/local/lib/python3.5/dist-packages (from coreschema->coreapi>=2.3.0->django-rest-swagger>=2.1.0->-r requirements.txt (line 8))
Requirement already up-to-date: MarkupSafe>=0.23 in /usr/local/lib/python3.5/dist-packages (from jinja2->coreschema->coreapi>=2.3.0->django-rest-swagger>=2.1.0->-r requirements.txt (line 8))
Installing collected packages: djangorestframework
Found existing installation: djangorestframework 3.6.4
Uninstalling djangorestframework-3.6.4:
Successfully uninstalled djangorestframework-3.6.4
Successfully installed djangorestframework-3.7.0
Applying database migrations (python3 netbox/manage.py migrate)...
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/rest_framework/settings.py", line 180, in import_from_string
module = import_module(module_path)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/opt/netbox-2.1.5/netbox/utilities/api.py", line 7, in <module>
from rest_framework.compat import is_authenticated
ImportError: cannot import name 'is_authenticated'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "netbox/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 327, in execute
self.check()
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python3.5/dist-packages/django/core/management/commands/migrate.py", line 62, in _run_checks
issues.extend(super(Command, self)._run_checks(**kwargs))
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "/usr/local/lib/python3.5/dist-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python3.5/dist-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
File "/usr/local/lib/python3.5/dist-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 254, in check
for pattern in self.url_patterns:
File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 405, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 398, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/opt/netbox-2.1.5/netbox/netbox/urls.py", line 3, in <module>
from rest_framework_swagger.views import get_swagger_view
File "/usr/local/lib/python3.5/dist-packages/rest_framework_swagger/views.py", line 5, in <module>
from rest_framework.schemas import SchemaGenerator
File "/usr/local/lib/python3.5/dist-packages/rest_framework/schemas/__init__.py", line 32, in <module>
authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES,
File "/usr/local/lib/python3.5/dist-packages/rest_framework/settings.py", line 223, in __getattr__
val = perform_import(val, attr)
File "/usr/local/lib/python3.5/dist-packages/rest_framework/settings.py", line 168, in perform_import
return [import_from_string(item, setting_name) for item in val]
File "/usr/local/lib/python3.5/dist-packages/rest_framework/settings.py", line 168, in <listcomp>
return [import_from_string(item, setting_name) for item in val]
File "/usr/local/lib/python3.5/dist-packages/rest_framework/settings.py", line 184, in import_from_string
raise ImportError(msg)
ImportError: Could not import 'utilities.api.TokenAuthentication' for API setting 'DEFAULT_AUTHENTICATION_CLASSES'. ImportError: cannot import name 'is_authenticated'.
Collecting static files (python3 netbox/manage.py collectstatic --no-input)...
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/fonts/fontawesome-webfont.svg'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/fonts/fontawesome-webfont.woff'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/fonts/glyphicons-halflings-regular.eot'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/fonts/glyphicons-halflings-regular.woff'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/fonts/glyphicons-halflings-regular.woff2'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/fonts/glyphicons-halflings-regular.svg'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/fonts/glyphicons-halflings-regular.ttf'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/fonts/fontawesome-webfont.eot'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/fonts/fontawesome-webfont.ttf'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/css/font-awesome-4.0.3.css'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/css/highlight.css'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/css/bootstrap-theme.min.css'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/css/base.css'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/css/jquery.json-view.min.css'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/css/bootstrap.min.css'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/js/jquery.json-view.min.js'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/js/highlight.pack.js'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/js/bootstrap.min.js'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/js/jquery-1.10.2.min.js'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/js/api.js'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/img/favicon.ico'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/docs/img/grid.png'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.eot'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.woff'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.woff2'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.svg'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.ttf'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/css/bootstrap-tweaks.css'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/css/default.css'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/css/bootstrap.min.css'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/css/prettify.css'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/js/ajax-form.js'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/js/default.js'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/js/bootstrap.min.js'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/js/coreapi-0.1.1.js'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/js/prettify-min.js'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/js/jquery-1.12.4.min.js'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/js/csrf.js'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/img/grid.png'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/img/glyphicons-halflings-white.png'
Copying '/usr/local/lib/python3.5/dist-packages/rest_framework/static/rest_framework/img/glyphicons-halflings.png'
41 static files copied to '/opt/netbox-2.1.5/netbox/static', 223 unmodified.
root@netbox:/opt/netbox# pip3 install djangorestframework==3.6.4
Collecting djangorestframework==3.6.4
Using cached djangorestframework-3.6.4-py2.py3-none-any.whl
Installing collected packages: djangorestframework
Found existing installation: djangorestframework 3.7.0
Uninstalling djangorestframework-3.7.0:
Successfully uninstalled djangorestframework-3.7.0
Successfully installed djangorestframework-3.6.4
root@netbox:/opt/netbox# sudo systemctl restart netbox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment