mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Remove 'parent' attribute from VMinterface
This commit is contained in:
@ -47,7 +47,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>Virtual Machine</td>
|
<td>Virtual Machine</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ vminterface.parent.get_absolute_url }}">{{ vminterface.parent }}</a>
|
<a href="{{ vminterface.virtual_machine.get_absolute_url }}">{{ vminterface.virtual_machine }}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -447,7 +447,7 @@ class VMInterface(BaseInterface):
|
|||||||
def clean(self):
|
def clean(self):
|
||||||
|
|
||||||
# Validate untagged VLAN
|
# Validate untagged VLAN
|
||||||
if self.untagged_vlan and self.untagged_vlan.site not in [self.parent.site, None]:
|
if self.untagged_vlan and self.untagged_vlan.site not in [self.virtual_machine.site, None]:
|
||||||
raise ValidationError({
|
raise ValidationError({
|
||||||
'untagged_vlan': "The untagged VLAN ({}) must belong to the same site as the interface's parent "
|
'untagged_vlan': "The untagged VLAN ({}) must belong to the same site as the interface's parent "
|
||||||
"virtual machine, or it must be global".format(self.untagged_vlan)
|
"virtual machine, or it must be global".format(self.untagged_vlan)
|
||||||
@ -475,10 +475,6 @@ class VMInterface(BaseInterface):
|
|||||||
object_data=serialize_object(self)
|
object_data=serialize_object(self)
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
|
||||||
def parent(self):
|
|
||||||
return self.virtual_machine
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def count_ipaddresses(self):
|
def count_ipaddresses(self):
|
||||||
return self.ip_addresses.count()
|
return self.ip_addresses.count()
|
||||||
|
Reference in New Issue
Block a user