Skip to content

Commit

Permalink
Show the LAN IP address(es) on the machine detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamgilbert committed Jan 27, 2014
1 parent a460d77 commit 2585127
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions server/templates/server/machine_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ <h3>Machine</h3>
<th>Serial:</th>
<td>{{ machine.serial }}</td>
</tr>
<tr>
<th>LAN IP Address:</th>
<td>{{ ip_address }}</td>
</tr>
{% if 'MachineInfo' in report %}
<tr>
<th>Hostname:</th>
Expand Down
8 changes: 7 additions & 1 deletion server/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,12 @@ def machine_detail(request, machine_id):
conditions = conditions.exclude(condition_name=excluded)
else:
conditions = None

# get the IP address(es) from the condition
ip_address = conditions.get(machine=machine, condition_name__exact='ipv4_address')
ip_address = ip_address.condition_data
print ip_address

install_results = {}
for result in report.get('InstallResults', []):
nameAndVers = result['name'] + '-' + result['version']
Expand Down Expand Up @@ -475,7 +481,7 @@ def machine_detail(request, machine_id):
if 'managed_uninstalls_list' in report:
report['managed_uninstalls_list'].sort()

c = {'user':user, 'machine_group': machine_group, 'business_unit': business_unit, 'report': report, 'install_results': install_results, 'removal_results': removal_results, 'machine': machine, 'facts':facts, 'conditions':conditions }
c = {'user':user, 'machine_group': machine_group, 'business_unit': business_unit, 'report': report, 'install_results': install_results, 'removal_results': removal_results, 'machine': machine, 'facts':facts, 'conditions':conditions, 'ip_address':ip_address }
return render_to_response('server/machine_detail.html', c, context_instance=RequestContext(request))

# checkin
Expand Down

0 comments on commit 2585127

Please sign in to comment.