Skip to content

API call headers #5

@bogdancordos

Description

@bogdancordos

I'm running the fallowing configuration:

{
    "django-version": "3.2.8",
    "installed-apps": {
        "debug_toolbar": "3.2.2",
        "django_filters": "21.1",
        "django_prometheus": "2.1.0",
        "django_rq": "2.4.1",
        "django_tables2": "2.4.1",
        "drf_yasg": "1.20.0",
        "graphene_django": "2.15.0",
        "graphiql_debug_toolbar": "0.2.0",
        "mptt": "0.13.4",
        "netbox_cisco_support": "0.6",
        "netbox_dns": "0.5.0",
        "rest_framework": "3.12.4",
        "taggit": "1.5.1",
        "timezone_field": "4.2.1"
    },
    "netbox-version": "3.0.8",
    "plugins": {
        "netbox_cisco_support": "0.6",
        "netbox_dns": "0.5.0",
        "nextbox_ui_plugin": "0.9.2",
        "phonebox_plugin": "v0.0.2-beta.3"
    },
    "python-version": "3.8.10",
    "rq-workers-running": 1
}

With plugins config:

PLUGINS = ['netbox_dns','nextbox_ui_plugin','phonebox_plugin', 'netbox_cisco_support']

PLUGINS_CONFIG = {
    'netbox_cisco_support': {
        'cisco_client_id': 'masked_client_id',
		'cisco_client_secret': 'masked_client_secret'
	}
}

When I'm running the python3 manage.py sync_eox_data for the first time, I get the fallowing error:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/opt/netbox/venv/lib/python3.8/site-packages/netbox_cisco_support/management/commands/sync_eox_data.py", line 292, in handle
    api_call_headers = self.logon()
  File "/opt/netbox/venv/lib/python3.8/site-packages/netbox_cisco_support/management/commands/sync_eox_data.py", line 282, in logon
    api_call_headers = {'Authorization': 'Bearer ' + tokens['access_token'], 'Accept': 'application/json'}
KeyError: 'access_token'

Is there something wrong with my access to Cisco API or do I need some extra config to pass a token?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions