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

Merge develop into develop-2.10

This commit is contained in:
Jeremy Stretch
2020-09-04 16:09:05 -04:00
parent ec66e1a5c0
commit 08c492f1f4
46 changed files with 464 additions and 117 deletions

View File

@ -335,13 +335,13 @@ class VirtualMachine(ChangeLoggedModel, ConfigContextModel, CustomFieldModel):
for field in ['primary_ip4', 'primary_ip6']:
ip = getattr(self, field)
if ip is not None:
if ip.interface in interfaces:
if ip.assigned_object in interfaces:
pass
elif self.primary_ip4.nat_inside is not None and self.primary_ip4.nat_inside.interface in interfaces:
elif ip.nat_inside is not None and ip.nat_inside.assigned_object in interfaces:
pass
else:
raise ValidationError({
field: "The specified IP address ({}) is not assigned to this VM.".format(ip),
field: f"The specified IP address ({ip}) is not assigned to this VM.",
})
def to_csv(self):