Skip to content

Commit 9b177f5

Browse files
authored
Merge pull request #137 from k01ek/develop
Develop
2 parents f04e40f + a7422e0 commit 9b177f5

File tree

8 files changed

+24
-18
lines changed

8 files changed

+24
-18
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PYTHON_VER?=3.8
2-
NETBOX_VER?=v3.4.0
2+
NETBOX_VER?=v3.5.1
33

44
NAME=netbox-bgp
55

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This plugin provide following Models:
1919
| NetBox 3.2 | >= 0.6.0 |
2020
| NetBox 3.3 | >= 0.8.1 |
2121
| NetBox 3.4 | >= 0.9.0 |
22+
| NetBox 3.5 | >= 0.10.0 |
2223

2324
## Installation
2425

@@ -40,6 +41,7 @@ See [NetBox Documentation](https://docs.netbox.dev/en/stable/plugins/#installing
4041
The following options are available:
4142
* `device_ext_page`: String (default right) Device related BGP sessions table position. The following values are available:
4243
left, right, full_width. Set empty value for disable.
44+
* `top_level_menu`: Bool (default False) Enable top level section navigation menu for the plugin.
4345

4446
## Screenshots
4547

@@ -59,4 +61,4 @@ Routing Policy
5961
![Routing Policy](docs/img/routepolicy.png)
6062

6163
Prefix List
62-
![Prefix List](docs/img/preflist.png)
64+
![Prefix List](docs/img/preflist.png)

develop/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ RUN git clone --single-branch --branch ${netbox_ver} https://github.com/netbox-c
1515
cd /opt/netbox/ && \
1616
pip install -r /opt/netbox/requirements.txt
1717

18-
# Work around https://github.com/rq/django-rq/issues/421
19-
RUN pip install django-rq==2.3.2
20-
2118
# -------------------------------------------------------------------------------------
2219
# Install Netbox Plugin
2320
# -------------------------------------------------------------------------------------
@@ -28,4 +25,4 @@ COPY . /source
2825
#RUN pip install -r requirements.txt
2926
RUN python setup.py develop
3027

31-
WORKDIR /opt/netbox/netbox/
28+
WORKDIR /opt/netbox/netbox/

develop/dev.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PGPASSWORD=decinablesprewad
66
DB_HOST=postgres
77
NAPALM_TIMEOUT=5
88
MAX_PAGE_SIZE=0
9-
SECRET_KEY=bqn8nn4qmjvx4hv2u5qr4pp46s3w9skbb63y
9+
SECRET_KEY=bqn8nn4qmjvx4hv2u5qr4pp46s3w9skbb63yaiyoos0sho6ath
1010
POSTGRES_USER=netbox
1111
POSTGRES_PASSWORD=decinablesprewad
1212
POSTGRES_DB=netbox

netbox_bgp/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class BGPConfig(PluginConfig):
1111
author_email = '[email protected]'
1212
base_url = 'bgp'
1313
required_settings = []
14-
min_version = '3.4.0'
15-
max_version = '3.4.99'
14+
min_version = '3.5.0'
15+
max_version = '3.5.99'
1616
default_settings = {
1717
'device_ext_page': 'right',
1818
'top_level_menu' : False,

netbox_bgp/api/serializers.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,17 @@ class Meta:
167167
fields = '__all__'
168168

169169

170+
class NestedPrefixListSerializer(WritableNestedSerializer):
171+
url = HyperlinkedIdentityField(view_name='plugins:netbox_bgp:prefixlist')
172+
173+
class Meta:
174+
model = PrefixList
175+
fields = ("id", "url", "display", "name")
176+
177+
170178
class PrefixListRuleSerializer(NetBoxModelSerializer):
179+
prefix_list = NestedPrefixListSerializer()
180+
171181
class Meta:
172182
model = PrefixListRule
173183
fields = '__all__'

netbox_bgp/forms.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
from dcim.models import Device, Site
1111
from ipam.models import IPAddress, Prefix, ASN
1212
from ipam.formfields import IPNetworkFormField
13-
from utilities.forms import (
13+
from utilities.forms.fields import (
1414
DynamicModelChoiceField,
15-
DynamicModelMultipleChoiceField, StaticSelect,
16-
APISelect, APISelectMultiple, StaticSelectMultiple, TagFilterField
15+
DynamicModelMultipleChoiceField,
16+
TagFilterField
1717
)
18+
from utilities.forms.widgets import APISelect, APISelectMultiple
1819
from netbox.forms import NetBoxModelForm, NetBoxModelBulkEditForm, NetBoxModelFilterSetForm
1920

2021
from .models import (
@@ -33,7 +34,6 @@ class CommunityForm(NetBoxModelForm):
3334
status = forms.ChoiceField(
3435
required=False,
3536
choices=CommunityStatusChoices,
36-
widget=StaticSelect()
3737
)
3838
tenant = DynamicModelChoiceField(
3939
queryset=Tenant.objects.all(),
@@ -59,7 +59,6 @@ class CommunityFilterForm(NetBoxModelFilterSetForm):
5959
status = forms.MultipleChoiceField(
6060
choices=CommunityStatusChoices,
6161
required=False,
62-
widget=StaticSelectMultiple()
6362
)
6463
site = DynamicModelChoiceField(
6564
queryset=Site.objects.all(),
@@ -87,7 +86,6 @@ class CommunityBulkEditForm(NetBoxModelBulkEditForm):
8786
status = forms.ChoiceField(
8887
required=False,
8988
choices=CommunityStatusChoices,
90-
widget=StaticSelect()
9189
)
9290

9391
model = Community
@@ -176,7 +174,7 @@ class Meta:
176174
('Policies', ('import_policies', 'export_policies'))
177175
)
178176
widgets = {
179-
'status': StaticSelect(),
177+
'status': forms.Select(),
180178
}
181179

182180

@@ -226,7 +224,6 @@ class BGPSessionFilterForm(NetBoxModelFilterSetForm):
226224
status = forms.MultipleChoiceField(
227225
choices=SessionStatusChoices,
228226
required=False,
229-
widget=StaticSelectMultiple()
230227
)
231228
peer_group = DynamicModelMultipleChoiceField(
232229
queryset=BGPPeerGroup.objects.all(),

netbox_bgp/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.9.0"
1+
__version__ = "0.10.0"

0 commit comments

Comments
 (0)