Skip to content

Commit fb168a8

Browse files
committed
fixes invalid parameter to prefetch_related()
1 parent 5c84690 commit fb168a8

File tree

6 files changed

+24
-8
lines changed

6 files changed

+24
-8
lines changed

Dockerfile

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
FROM netboxcommunity/netbox:v3.5.9
1+
FROM python:3.11
2+
3+
ENV PYTHONUNBUFFERED 1
4+
5+
RUN mkdir -p /opt
26

37
RUN pip install --upgrade pip\
48
&& pip install poetry
59

6-
RUN mkdir -p /source
7-
WORKDIR /source
8-
COPY . /source
10+
# -------------------------------------------------------------------------------------
11+
# install netbox
12+
# -------------------------------------------------------------------------------------
13+
ARG netbox_ver=master
14+
15+
RUN git clone --single-branch --branch ${netbox_ver} https://github.com/netbox-community/netbox.git /opt/netbox/ && \
16+
cd /opt/netbox/ && \
17+
pip install -r /opt/netbox/requirements.txt
18+
19+
# -------------------------------------------------------------------------------------
20+
# install netbox atlas plugin
21+
# -------------------------------------------------------------------------------------
22+
RUN mkdir -p /plugin
23+
WORKDIR /plugin
24+
COPY . /plugin
925
RUN poetry config virtualenvs.create false \
1026
&& poetry install --no-interaction --no-ansi
1127

docker-compose.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ services:
1515
- redis
1616
env_file:
1717
- ./.env
18-
user: 'unit:root'
1918
volumes:
2019
- ./netbox_configuration.py:/opt/netbox/netbox/netbox/configuration.py:ro,Z
2120
- ./:/source:ro,Z

netbox_atlas_plugin/api/labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def add_netbox_labels(self, obj):
1818
self.__setitem__('model', obj.device_type.model)
1919

2020
if getattr(obj, "role", None) is not None:
21-
self.__setitem__('role', obj.device_role.slug)
21+
self.__setitem__('role', obj.role.slug)
2222

2323
if getattr(obj, "site", None) is not None:
2424
self.__setitem__('site', obj.site.slug)

netbox_atlas_plugin/api/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class VirtualMachineViewSet(
2929
class DeviceViewSet(NetBoxModelViewSet):
3030
queryset = Device.objects.prefetch_related(
3131
"device_type",
32-
"device_role",
32+
"role",
3333
"primary_ip4",
3434
"platform",
3535
"site",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ packages = [
1111
]
1212

1313
[tool.poetry.dependencies]
14-
python = "^3.8"
14+
python = "^3.10"
1515

1616
[tool.poetry.dev-dependencies]
1717
black = "^23.1"

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
"Programming Language :: Python :: 3.6",
2525
"Programming Language :: Python :: 3.7",
2626
"Programming Language :: Python :: 3.8",
27+
"Programming Language :: Python :: 3.10",
2728
],
2829
)

0 commit comments

Comments
 (0)