mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #4649: Fix interface assignment for bulk-imported IP addresses
This commit is contained in:
@ -9,6 +9,7 @@ v2.8.5 (FUTURE)
|
|||||||
* [#4646](https://github.com/netbox-community/netbox/issues/4646) - Correct UI link for reports with custom name
|
* [#4646](https://github.com/netbox-community/netbox/issues/4646) - Correct UI link for reports with custom name
|
||||||
* [#4647](https://github.com/netbox-community/netbox/issues/4647) - Fix caching invalidation issue related to assigning new IP addresses to interfaces
|
* [#4647](https://github.com/netbox-community/netbox/issues/4647) - Fix caching invalidation issue related to assigning new IP addresses to interfaces
|
||||||
* [#4648](https://github.com/netbox-community/netbox/issues/4648) - Fix bulk CSV import of child devices
|
* [#4648](https://github.com/netbox-community/netbox/issues/4648) - Fix bulk CSV import of child devices
|
||||||
|
* [#4649](https://github.com/netbox-community/netbox/issues/4649) - Fix interface assignment for bulk-imported IP addresses
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -780,18 +780,6 @@ class IPAddressCSVForm(CustomFieldModelCSVForm):
|
|||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
|
|
||||||
# Set interface
|
|
||||||
if self.cleaned_data['device'] and self.cleaned_data['interface_name']:
|
|
||||||
self.instance.interface = Interface.objects.get(
|
|
||||||
device=self.cleaned_data['device'],
|
|
||||||
name=self.cleaned_data['interface_name']
|
|
||||||
)
|
|
||||||
elif self.cleaned_data['virtual_machine'] and self.cleaned_data['interface_name']:
|
|
||||||
self.instance.interface = Interface.objects.get(
|
|
||||||
virtual_machine=self.cleaned_data['virtual_machine'],
|
|
||||||
name=self.cleaned_data['interface_name']
|
|
||||||
)
|
|
||||||
|
|
||||||
ipaddress = super().save(*args, **kwargs)
|
ipaddress = super().save(*args, **kwargs)
|
||||||
|
|
||||||
# Set as primary for device/VM
|
# Set as primary for device/VM
|
||||||
|
Reference in New Issue
Block a user