1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Merge v2.11.9

This commit is contained in:
jeremystretch
2021-07-08 12:15:57 -04:00
9 changed files with 24 additions and 8 deletions

View File

@ -17,7 +17,7 @@ body:
What version of NetBox are you currently running? (If you don't have access to the most What version of NetBox are you currently running? (If you don't have access to the most
recent NetBox release, consider testing on our [demo instance](https://demo.netbox.dev/) recent NetBox release, consider testing on our [demo instance](https://demo.netbox.dev/)
before opening a bug report to see if your issue has already been addressed.) before opening a bug report to see if your issue has already been addressed.)
placeholder: v2.11.8 placeholder: v2.11.9
validations: validations:
required: true required: true
- type: dropdown - type: dropdown

View File

@ -14,7 +14,7 @@ body:
attributes: attributes:
label: NetBox version label: NetBox version
description: What version of NetBox are you currently running? description: What version of NetBox are you currently running?
placeholder: v2.11.8 placeholder: v2.11.9
validations: validations:
required: true required: true
- type: dropdown - type: dropdown

View File

@ -1,5 +1,15 @@
# NetBox v2.11 # NetBox v2.11
## v2.11.9 (2021-07-08)
### Bug Fixes
* [#6456](https://github.com/netbox-community/netbox/issues/6456) - API schema type should be boolean for `_occupied` on cable termination models
* [#6710](https://github.com/netbox-community/netbox/issues/6710) - Fix assignment of VM interface parent via REST API
* [#6714](https://github.com/netbox-community/netbox/issues/6714) - Fix rendering of device type component creation forms
---
## v2.11.8 (2021-07-06) ## v2.11.8 (2021-07-06)
### Enhancements ### Enhancements

View File

@ -25,6 +25,7 @@ from .nested_serializers import *
class CableTerminationSerializer(serializers.ModelSerializer): class CableTerminationSerializer(serializers.ModelSerializer):
cable_peer_type = serializers.SerializerMethodField(read_only=True) cable_peer_type = serializers.SerializerMethodField(read_only=True)
cable_peer = serializers.SerializerMethodField(read_only=True) cable_peer = serializers.SerializerMethodField(read_only=True)
_occupied = serializers.SerializerMethodField(read_only=True)
def get_cable_peer_type(self, obj): def get_cable_peer_type(self, obj):
if obj._cable_peer is not None: if obj._cable_peer is not None:
@ -42,6 +43,10 @@ class CableTerminationSerializer(serializers.ModelSerializer):
return serializer(obj._cable_peer, context=context).data return serializer(obj._cable_peer, context=context).data
return None return None
@swagger_serializer_method(serializer_or_field=serializers.BooleanField)
def get__occupied(self, obj):
return obj._occupied
class ConnectedEndpointSerializer(serializers.ModelSerializer): class ConnectedEndpointSerializer(serializers.ModelSerializer):
connected_endpoint_type = serializers.SerializerMethodField(read_only=True) connected_endpoint_type = serializers.SerializerMethodField(read_only=True)

View File

@ -1211,8 +1211,9 @@ class InterfaceTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCase
{ {
'device': device.pk, 'device': device.pk,
'name': 'Interface 6', 'name': 'Interface 6',
'type': '1000base-t', 'type': 'virtual',
'mode': InterfaceModeChoices.MODE_TAGGED, 'mode': InterfaceModeChoices.MODE_TAGGED,
'parent': interfaces[0].pk,
'tagged_vlans': [vlans[0].pk, vlans[1].pk], 'tagged_vlans': [vlans[0].pk, vlans[1].pk],
'untagged_vlan': vlans[2].pk, 'untagged_vlan': vlans[2].pk,
}, },

View File

@ -30,7 +30,7 @@
{{ field }} {{ field }}
{% endfor %} {% endfor %}
{% for field in form.visible_fields %} {% for field in form.visible_fields %}
{% if field.name not in form.custom_fields %} {% if not form.custom_fields or field.name not in form.custom_fields %}
{% render_field field %} {% render_field field %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@ -1,8 +1,7 @@
from rest_framework import serializers from rest_framework import serializers
from dcim.models import Interface
from netbox.api import WritableNestedSerializer from netbox.api import WritableNestedSerializer
from virtualization.models import Cluster, ClusterGroup, ClusterType, VirtualMachine from virtualization.models import Cluster, ClusterGroup, ClusterType, VirtualMachine, VMInterface
__all__ = [ __all__ = [
'NestedClusterGroupSerializer', 'NestedClusterGroupSerializer',
@ -61,5 +60,5 @@ class NestedVMInterfaceSerializer(WritableNestedSerializer):
virtual_machine = NestedVirtualMachineSerializer(read_only=True) virtual_machine = NestedVirtualMachineSerializer(read_only=True)
class Meta: class Meta:
model = Interface model = VMInterface
fields = ['id', 'url', 'display', 'virtual_machine', 'name'] fields = ['id', 'url', 'display', 'virtual_machine', 'name']

View File

@ -252,6 +252,7 @@ class VMInterfaceTest(APIViewTestCases.APIViewTestCase):
{ {
'virtual_machine': virtualmachine.pk, 'virtual_machine': virtualmachine.pk,
'name': 'Interface 6', 'name': 'Interface 6',
'parent': interfaces[0].pk,
'mode': InterfaceModeChoices.MODE_TAGGED, 'mode': InterfaceModeChoices.MODE_TAGGED,
'tagged_vlans': [vlans[0].pk, vlans[1].pk], 'tagged_vlans': [vlans[0].pk, vlans[1].pk],
'untagged_vlan': vlans[2].pk, 'untagged_vlan': vlans[2].pk,

View File

@ -18,7 +18,7 @@ gunicorn==20.1.0
Jinja2==3.0.1 Jinja2==3.0.1
Markdown==3.3.4 Markdown==3.3.4
netaddr==0.8.0 netaddr==0.8.0
Pillow==8.3.0 Pillow==8.3.1
psycopg2-binary==2.9.1 psycopg2-binary==2.9.1
pycryptodome==3.10.1 pycryptodome==3.10.1
PyYAML==5.4.1 PyYAML==5.4.1