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

Grafana Navigation Included when not installed #241

Closed
whitej6 opened this issue Aug 15, 2023 · 4 comments · Fixed by #262
Closed

Grafana Navigation Included when not installed #241

whitej6 opened this issue Aug 15, 2023 · 4 comments · Fixed by #262

Comments

@whitej6
Copy link
Contributor

whitej6 commented Aug 15, 2023

Environment

  • Python version: NA
  • Nautobot version: NA
  • nautobot-plugin-chatops version: 2.0.2

Steps to Reproduce

  1. Install chatops without grafana extras
  2. click plugins navigation menu

Expected Behavior

Grafana links are omitted when not installed

Observed Behavior

Grafana links return a link error
image

@EdificomSA
Copy link

EdificomSA commented Aug 23, 2023

I confirm, also in logs :

Grafana ChatOps integration is not available.
nautobot-docker-compose-nautobot-1   | Traceback (most recent call last):
nautobot-docker-compose-nautobot-1   |   File "/opt/nautobot/.local/lib/python3.10/site-packages/nautobot_chatops/urls.py", line 22, in <module>
nautobot-docker-compose-nautobot-1   |     from nautobot_chatops.integrations.grafana.urls import urlpatterns as grafana_urlpatterns
nautobot-docker-compose-nautobot-1   |   File "/opt/nautobot/.local/lib/python3.10/site-packages/nautobot_chatops/integrations/grafana/urls.py", line 5, in <module>
nautobot-docker-compose-nautobot-1   |     from nautobot_chatops.integrations.grafana.views import (
nautobot-docker-compose-nautobot-1   |   File "/opt/nautobot/.local/lib/python3.10/site-packages/nautobot_chatops/integrations/grafana/views.py", line 19, in <module>
nautobot-docker-compose-nautobot-1   |     from nautobot_chatops.integrations.grafana.diffsync.sync import run_dashboard_sync, run_panels_sync, run_variables_sync
nautobot-docker-compose-nautobot-1   |   File "/opt/nautobot/.local/lib/python3.10/site-packages/nautobot_chatops/integrations/grafana/diffsync/sync.py", line 4, in <module>
nautobot-docker-compose-nautobot-1   |     from nautobot_chatops.integrations.grafana.grafana import handler
nautobot-docker-compose-nautobot-1   |   File "/opt/nautobot/.local/lib/python3.10/site-packages/nautobot_chatops/integrations/grafana/grafana.py", line 378, in <module>
nautobot-docker-compose-nautobot-1   |     handler = GrafanaHandler(PLUGIN_SETTINGS)
nautobot-docker-compose-nautobot-1   |   File "/opt/nautobot/.local/lib/python3.10/site-packages/nautobot_chatops/integrations/grafana/grafana.py", line 60, in __init__
nautobot-docker-compose-nautobot-1   |     self.config = _get_settings_from_chatops(config)
nautobot-docker-compose-nautobot-1   |   File "/opt/nautobot/.local/lib/python3.10/site-packages/nautobot_chatops/integrations/grafana/grafana.py", line 38, in _get_settings_from_chatops
nautobot-docker-compose-nautobot-1   |     return GrafanaConfigSettings(
nautobot-docker-compose-nautobot-1   |   File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
nautobot-docker-compose-nautobot-1   | pydantic.error_wrappers.ValidationError: 1 validation error for GrafanaConfigSettings
nautobot-docker-compose-nautobot-1   | default_timespan
nautobot-docker-compose-nautobot-1   |   invalid duration format (type=value_error.duration)

@tylersiemers
Copy link

Confirm same issue. Setting 'enable_grafana': False doesn't work either and the links remain.

@mattmiller87
Copy link
Contributor

With this being a pydantic error, is there a validator happening on launch which is checking all code and is flagging grafana first?

pydantic.error_wrappers.ValidationError

@smk4664
Copy link
Contributor

smk4664 commented Sep 22, 2023

Thanks! I will look into this. It should be behaving like the other integrations.

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

Successfully merging a pull request may close this issue.

5 participants