Fix export of system data & include plugins

This commit is contained in:
Jeremy Stretch 2024-08-01 09:36:23 -04:00
parent 149c80a10e
commit bf17485290
2 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import json
import platform
from django import __version__ as DJANGO_VERSION
from django.apps import apps
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.mixins import UserPassesTestMixin
@ -630,9 +631,11 @@ class SystemView(UserPassesTestMixin, View):
# Raw data export
if 'export' in request.GET:
stats['netbox_release'] = stats['netbox_release'].asdict()
params = [param.name for param in PARAMS]
data = {
**stats,
'plugins': settings.PLUGINS,
'config': {
k: getattr(config, k) for k in sorted(params)
},

View File

@ -1,7 +1,7 @@
import datetime
import os
import yaml
from dataclasses import dataclass, field
from dataclasses import asdict, dataclass, field
from typing import List, Union
from django.core.exceptions import ImproperlyConfigured
@ -42,6 +42,9 @@ class ReleaseInfo:
def name(self):
return f"NetBox {self.edition} v{self.full_version}"
def asdict(self):
return asdict(self)
def load_release_data():
"""