Skip to content

Commit 5779448

Browse files
committed
Prepare for Netbox 4.2
1 parent de301b9 commit 5779448

File tree

7 files changed

+64
-63
lines changed

7 files changed

+64
-63
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Load data from YAML files into Netbox
77
First activate your virtual environment where Netbox is installed, the install the plugin version correspondig to your Netbox version.
88

99
```bash
10-
pip install "netbox-initializers==4.1.*"
10+
pip install "netbox-initializers==4.2.*"
1111
```
1212

1313
Then you need to add the plugin to the `PLUGINS` array in the Netbox configuration.
@@ -38,6 +38,6 @@ The initializers where a part of the Docker image and where then extracted into
3838
To use the new plugin in a the Netbox Docker image, it musst be installad into the image. To this, the following example can be used as a starting point:
3939

4040
```dockerfile
41-
FROM netboxcommunity/netbox:v4.1
42-
RUN /opt/netbox/venv/bin/pip install "netbox-initializers==4.1.*"
41+
FROM netboxcommunity/netbox:v4.2
42+
RUN /opt/netbox/venv/bin/pip install "netbox-initializers==4.2.*"
4343
```

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ license = "Apache-2.0"
1414
dynamic = ["version"]
1515

1616
requires-python = ">=3.10"
17-
dependencies = ["ruamel-yaml>=0.18.6"]
17+
dependencies = ["ruamel-yaml>=0.18.10"]
1818

1919
[build-system]
2020
requires = ["hatchling"]
@@ -24,7 +24,7 @@ build-backend = "hatchling.build"
2424
path = "src/netbox_initializers/version.py"
2525

2626
[tool.uv]
27-
dev-dependencies = ["ruff==0.6.3"]
27+
dev-dependencies = ["ruff==0.9.1"]
2828

2929
[tool.ruff]
3030
line-length = 100

src/netbox_initializers/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class NetBoxInitializersConfig(PluginConfig):
99
description = "Load initial data into Netbox"
1010
version = VERSION
1111
base_url = "initializers"
12-
min_version = "4.1-beta1"
13-
max_version = "4.1.99"
12+
min_version = "4.2.0"
13+
max_version = "4.2.99"
1414

1515

1616
config = NetBoxInitializersConfig

src/netbox_initializers/initializers/users.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from django.utils.crypto import get_random_string
12
from users.models import Token, User
23

34
from netbox_initializers.initializers.base import BaseInitializer, register_initializer
@@ -13,7 +14,7 @@ def load_data(self):
1314

1415
for username, user_details in users.items():
1516
api_token = user_details.pop("api_token", Token.generate_key())
16-
password = user_details.pop("password", User.objects.make_random_password())
17+
password = user_details.pop("password", get_random_string(length=25))
1718
user, created = User.objects.get_or_create(username=username, defaults=user_details)
1819
if created:
1920
user.set_password(password)

src/netbox_initializers/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "4.1.0"
1+
VERSION = "4.2.0"

test/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM netboxcommunity/netbox:feature
1+
FROM netboxcommunity/netbox:v4.2
22

33
COPY ../ /opt/netbox-initializers/
44
COPY ./test/config/plugins.py /etc/netbox/config/

uv.lock

Lines changed: 53 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)