Skip to content

Commit

Permalink
Prepare release 3.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasge committed Jan 4, 2024
1 parent 04fbb73 commit 842ec6b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 37 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Load data from YAML files into Netbox

First activate your virtual environment where Netbox is installed, the install the plugin version correspondig to your Netbox version.
```bash
pip install "netbox-initializers==3.6.*"
pip install "netbox-initializers==3.7.*"
```
Then you need to add the plugin to the `PLUGINS` array in the Netbox configuration.
```python
Expand Down Expand Up @@ -36,6 +36,6 @@ The initializers where a part of the Docker image and where then extracted into
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:

```dockerfile
FROM netboxcommunity/netbox:v3.6
RUN /opt/netbox/venv/bin/pip install "netbox-initializers==3.6.*"
FROM netboxcommunity/netbox:v3.7
RUN /opt/netbox/venv/bin/pip install "netbox-initializers==3.7.*"
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = "Apache-2.0"
name = "netbox-initializers"
readme = "README.md"
repository = "https://github.com/tobiasge/netbox-initializers"
version = "3.6.0"
version = "3.7.0"

[tool.poetry.dependencies]
python = "^3.8"
Expand Down
6 changes: 3 additions & 3 deletions src/netbox_initializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ class NetBoxInitializersConfig(PluginConfig):
name = "netbox_initializers"
verbose_name = "NetBox Initializers"
description = "Load initial data into Netbox"
version = "3.6.0"
version = "3.7.0"
base_url = "initializers"
min_version = "3.6.0"
max_version = "3.6.99"
min_version = "3.7.0"
max_version = "3.7.99"


config = NetBoxInitializersConfig
10 changes: 0 additions & 10 deletions src/netbox_initializers/initializers/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,10 @@ def load_data(self):
if webhooks is None:
return
for hook in webhooks:
obj_types = hook.pop("object_types")

try:
obj_type_ids = [get_content_type_id(hook["name"], obj) for obj in obj_types]
except ContentType.DoesNotExist:
continue

matching_params, defaults = self.split_params(hook)
webhook, created = Webhook.objects.get_or_create(**matching_params, defaults=defaults)

if created:
webhook.content_types.set(obj_type_ids)
webhook.save()

print("🪝 Created Webhook {0}".format(webhook.name))


Expand Down
19 changes: 0 additions & 19 deletions src/netbox_initializers/initializers/yaml/webhooks.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
## Possible Choices:
## object_types:
## - device
## - site
## - any-other-content-type
## types:
## - type_create
## - type_update
## - type_delete
## Examples:

# - name: device_creation
# payload_url: 'http://localhost:8080'
# object_types:
# - device
# - cable
# type_create: True
# - name: device_update
# payload_url: 'http://localhost:8080'
# object_types:
# - device
# type_update: True
# - name: device_delete
# payload_url: 'http://localhost:8080'
# object_types:
# - device
# type_delete: True
2 changes: 1 addition & 1 deletion test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM netboxcommunity/netbox:v3.6
FROM netboxcommunity/netbox:v3.7

COPY ../ /opt/netbox-initializers/
COPY ./test/config/plugins.py /etc/netbox/config/
Expand Down

0 comments on commit 842ec6b

Please sign in to comment.