Skip to content

Commit

Permalink
Fixes #2202: Ditched half-baked concept of tenancy inheritance via VRF
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Jul 18, 2018
1 parent d665d4d commit 6e037e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
7 changes: 4 additions & 3 deletions netbox/templates/ipam/ipaddress.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ <h1>{% block title %}{{ ipaddress }}{% endblock %}</h1>
<td>Tenant</td>
<td>
{% if ipaddress.tenant %}
{% if ipaddress.tenant.group %}
<a href="{{ ipaddress.tenant.group.get_absolute_url }}">{{ ipaddress.tenant.group }}</a>
<i class="fa fa-angle-right"></i>
{% endif %}
<a href="{{ ipaddress.tenant.get_absolute_url }}">{{ ipaddress.tenant }}</a>
{% elif ipaddress.vrf.tenant %}
<a href="{{ ipaddress.vrf.tenant.get_absolute_url }}">{{ ipaddress.vrf.tenant }}</a>
<label class="label label-info">Inherited</label>
{% else %}
<span class="text-muted">None</span>
{% endif %}
Expand Down
7 changes: 0 additions & 7 deletions netbox/templates/ipam/prefix.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@
<i class="fa fa-angle-right"></i>
{% endif %}
<a href="{{ prefix.tenant.get_absolute_url }}">{{ prefix.tenant }}</a>
{% elif prefix.vrf.tenant %}
{% if prefix.vrf.tenant.group %}
<a href="{{ prefix.vrf.tenant.group.get_absolute_url }}">{{ prefix.vrf.tenant.group }}</a>
<i class="fa fa-angle-right"></i>
{% endif %}
<a href="{{ prefix.vrf.tenant.get_absolute_url }}">{{ prefix.vrf.tenant }}</a>
<label class="label label-info">Inherited</label>
{% else %}
<span class="text-muted">None</span>
{% endif %}
Expand Down
10 changes: 2 additions & 8 deletions netbox/tenancy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,8 @@ def get(self, request, slug):
'rackreservation_count': RackReservation.objects.filter(tenant=tenant).count(),
'device_count': Device.objects.filter(tenant=tenant).count(),
'vrf_count': VRF.objects.filter(tenant=tenant).count(),
'prefix_count': Prefix.objects.filter(
Q(tenant=tenant) |
Q(tenant__isnull=True, vrf__tenant=tenant)
).count(),
'ipaddress_count': IPAddress.objects.filter(
Q(tenant=tenant) |
Q(tenant__isnull=True, vrf__tenant=tenant)
).count(),
'prefix_count': Prefix.objects.filter(tenant=tenant).count(),
'ipaddress_count': IPAddress.objects.filter(tenant=tenant).count(),
'vlan_count': VLAN.objects.filter(tenant=tenant).count(),
'circuit_count': Circuit.objects.filter(tenant=tenant).count(),
'virtualmachine_count': VirtualMachine.objects.filter(tenant=tenant).count(),
Expand Down

0 comments on commit 6e037e9

Please sign in to comment.