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

NB-47 Support Added for NetBox v4 #52

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions .github/ISSUE_TEMPLATE/1-bug-report.yml

This file was deleted.

57 changes: 0 additions & 57 deletions .github/ISSUE_TEMPLATE/2-feature-request.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/ISSUE_TEMPLATE/3-documentation-change.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/ISSUE_TEMPLATE/4-housekeeping.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/ISSUE_TEMPLATE/5-deprecation.yml

This file was deleted.

23 changes: 16 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- published
workflow_dispatch: { }
push:
branches:
- '*'
tags:
- v[0-9]+.[0-9]+.[0-9]+(-[a-zA-Z]+[0-9]+)?
pull_request:
Expand All @@ -16,10 +18,10 @@ on:
jobs:
pre_commit:
name: Run lint rules
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-sh
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.1.1

- name: Set up Python
uses: actions/setup-python@v4.7.0
Expand All @@ -29,26 +31,33 @@ jobs:
- uses: pre-commit/action@v3.0.0

test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-sh
name: Runs plugin tests

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.1.1

- name: Login to Registry
uses: docker/login-action@v3
with:
registry: registry.tangience.net
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}

- name: Test the image
run: ./test.sh

changelog:
name: "Changelog Generator"
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-sh
needs:
- test
timeout-minutes: 30
if: startsWith(github.ref, 'refs/tags/')
if: github.event_name == 'release'
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v4.1.1

- name: "Generate changelog"
uses: charmixer/auto-changelog-action@v1.4
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NETBOX_VARIANT=v3.7
ARG NETBOX_VARIANT=v4.0

FROM netboxcommunity/netbox:${NETBOX_VARIANT}

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ NetBox PaaS integrates several key features:
| v3.5.x | v0.0.x |
| v3.6.x | v0.2.x |
| v3.7.x | v0.3.x |
| v4.0.x | v0.4.x |

# Installation

Expand Down
6 changes: 3 additions & 3 deletions netbox_paas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from importlib.metadata import metadata

from extras.plugins import PluginConfig
from netbox.plugins import PluginConfig

metadata = metadata("netbox_paas")

Expand All @@ -14,8 +14,8 @@ class NetBoxPaas(PluginConfig):
author = metadata.get("Author")
author_email = metadata.get("Author-email")
base_url = "paas"
min_version = "3.7.0"
max_version = "3.7.99"
min_version = "4.0.0"
max_version = "4.0.99"

def ready(self):
super().ready()
Expand Down
10 changes: 5 additions & 5 deletions netbox_paas/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.utils.translation import gettext as _

from netbox.forms import NetBoxModelForm
from utilities.forms import BootstrapMixin, ConfirmationForm as _ConfirmationForm
from utilities.forms import ConfirmationForm as _ConfirmationForm
from utilities.forms.fields import CommentField
from utilities.rqworker import get_workers_for_queue
from .constants import NETBOX_SETTINGS, NODE_GROUP_SQLDB, DISABLED_PLUGINS_FILE_NAME
Expand Down Expand Up @@ -101,7 +101,7 @@ def __init__(self, *args, **kwargs):
]


class NetBoxSettingsForm(BootstrapMixin, forms.Form):
class NetBoxSettingsForm(forms.Form):
fieldsets = create_fieldset()

class Meta:
Expand Down Expand Up @@ -153,7 +153,7 @@ def clean(self):
return data


class NetBoxBackupStorageForm(BootstrapMixin, forms.Form):
class NetBoxBackupStorageForm(forms.Form):
deployment = forms.ChoiceField(
choices=(
("standalone", "Standalone"),
Expand Down Expand Up @@ -272,7 +272,7 @@ def clean(self):
raise ValidationError({"db_password": "This field is required when adding a new backup."})


class NetBoxPluginInstallForm(BootstrapMixin, forms.Form):
class NetBoxPluginInstallForm(forms.Form):
name = forms.CharField(
label="Plugin Name",
help_text="Name of the plugin to install.",
Expand Down Expand Up @@ -372,7 +372,7 @@ def clean(self):
raise ValidationError({"configuration": f"Missing required settings: {', '.join(required_settings)}"})


class NetBoxUpgradeForm(BootstrapMixin, forms.Form):
class NetBoxUpgradeForm(forms.Form):
version = forms.ChoiceField(
label="Version",
help_text="Version to upgrade to.",
Expand Down
3 changes: 1 addition & 2 deletions netbox_paas/navigation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from extras.plugins import PluginMenu
from extras.plugins import PluginMenuItem
from netbox.plugins import PluginMenu, PluginMenuItem

menu = PluginMenu(
label="Netbox PAAS",
Expand Down
2 changes: 1 addition & 1 deletion netbox_paas/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from django.views.generic import View

from netbox.views import generic
from utilities.utils import normalize_querydict
from utilities.querydict import normalize_querydict
from utilities.views import register_model_view, GetReturnURLMixin
from . import constants, forms, models, tables, utils

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="netbox-paas",
version="0.3.4",
version="0.4.0",
description="Enhances NetBox on CloudMyDC's PaaS with advanced management and control features.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
Loading