Skip to content

Commit

Permalink
Merge pull request #136 from benley/netbox-3.5
Browse files Browse the repository at this point in the history
Support for NetBox 3.5
  • Loading branch information
k01ek authored May 11, 2023
2 parents a0d925a + 5e528c8 commit de2a531
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PYTHON_VER?=3.8
NETBOX_VER?=v3.4.0
NETBOX_VER?=v3.5.1

NAME=netbox-bgp

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This plugin provide following Models:
| NetBox 3.2 | >= 0.6.0 |
| NetBox 3.3 | >= 0.8.1 |
| NetBox 3.4 | >= 0.9.0 |
| NetBox 3.5 | >= 0.9.1 |

## Installation

Expand Down Expand Up @@ -60,4 +61,4 @@ Routing Policy
![Routing Policy](docs/img/routepolicy.png)

Prefix List
![Prefix List](docs/img/preflist.png)
![Prefix List](docs/img/preflist.png)
5 changes: 1 addition & 4 deletions develop/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ RUN git clone --single-branch --branch ${netbox_ver} https://github.com/netbox-c
cd /opt/netbox/ && \
pip install -r /opt/netbox/requirements.txt

# Work around https://github.com/rq/django-rq/issues/421
RUN pip install django-rq==2.3.2

# -------------------------------------------------------------------------------------
# Install Netbox Plugin
# -------------------------------------------------------------------------------------
Expand All @@ -28,4 +25,4 @@ COPY . /source
#RUN pip install -r requirements.txt
RUN python setup.py develop

WORKDIR /opt/netbox/netbox/
WORKDIR /opt/netbox/netbox/
2 changes: 1 addition & 1 deletion develop/dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PGPASSWORD=decinablesprewad
DB_HOST=postgres
NAPALM_TIMEOUT=5
MAX_PAGE_SIZE=0
SECRET_KEY=bqn8nn4qmjvx4hv2u5qr4pp46s3w9skbb63y
SECRET_KEY=bqn8nn4qmjvx4hv2u5qr4pp46s3w9skbb63yaiyoos0sho6ath
POSTGRES_USER=netbox
POSTGRES_PASSWORD=decinablesprewad
POSTGRES_DB=netbox
Expand Down
4 changes: 2 additions & 2 deletions netbox_bgp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class BGPConfig(PluginConfig):
author_email = '[email protected]'
base_url = 'bgp'
required_settings = []
min_version = '3.4.0'
max_version = '3.4.99'
min_version = '3.5.0'
max_version = '3.5.99'
default_settings = {
'device_ext_page': 'right',
'top_level_menu' : False,
Expand Down
13 changes: 5 additions & 8 deletions netbox_bgp/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
from dcim.models import Device, Site
from ipam.models import IPAddress, Prefix, ASN
from ipam.formfields import IPNetworkFormField
from utilities.forms import (
from utilities.forms.fields import (
DynamicModelChoiceField,
DynamicModelMultipleChoiceField, StaticSelect,
APISelect, APISelectMultiple, StaticSelectMultiple, TagFilterField
DynamicModelMultipleChoiceField,
TagFilterField
)
from utilities.forms.widgets import APISelect, APISelectMultiple
from netbox.forms import NetBoxModelForm, NetBoxModelBulkEditForm, NetBoxModelFilterSetForm

from .models import (
Expand All @@ -33,7 +34,6 @@ class CommunityForm(NetBoxModelForm):
status = forms.ChoiceField(
required=False,
choices=CommunityStatusChoices,
widget=StaticSelect()
)
tenant = DynamicModelChoiceField(
queryset=Tenant.objects.all(),
Expand All @@ -59,7 +59,6 @@ class CommunityFilterForm(NetBoxModelFilterSetForm):
status = forms.MultipleChoiceField(
choices=CommunityStatusChoices,
required=False,
widget=StaticSelectMultiple()
)
site = DynamicModelChoiceField(
queryset=Site.objects.all(),
Expand Down Expand Up @@ -87,7 +86,6 @@ class CommunityBulkEditForm(NetBoxModelBulkEditForm):
status = forms.ChoiceField(
required=False,
choices=CommunityStatusChoices,
widget=StaticSelect()
)

model = Community
Expand Down Expand Up @@ -176,7 +174,7 @@ class Meta:
('Policies', ('import_policies', 'export_policies'))
)
widgets = {
'status': StaticSelect(),
'status': forms.Select(),
}


Expand Down Expand Up @@ -226,7 +224,6 @@ class BGPSessionFilterForm(NetBoxModelFilterSetForm):
status = forms.MultipleChoiceField(
choices=SessionStatusChoices,
required=False,
widget=StaticSelectMultiple()
)
peer_group = DynamicModelMultipleChoiceField(
queryset=BGPPeerGroup.objects.all(),
Expand Down
2 changes: 1 addition & 1 deletion netbox_bgp/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.9.0"
__version__ = "0.9.1"

0 comments on commit de2a531

Please sign in to comment.