aboutsummaryrefslogtreecommitdiffstats
path: root/src/resource_inventory/pdf_templater.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2020-04-14 18:15:55 +0000
committerGerrit Code Review <gerrit@opnfv.org>2020-04-14 18:15:55 +0000
commit6bf37e9864787e0398a1d2e1cdd10b40a8ebc6e6 (patch)
tree18396967cc32110ae5455827e612e2846e55392c /src/resource_inventory/pdf_templater.py
parentd5b4f4c77534824430fd8e2d3f15e5f7ed6303f5 (diff)
parent557659acfd97ddaacdb89192ff6a575691b39093 (diff)
Merge "Add user + user list to API"
Diffstat (limited to 'src/resource_inventory/pdf_templater.py')
-rw-r--r--src/resource_inventory/pdf_templater.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/resource_inventory/pdf_templater.py b/src/resource_inventory/pdf_templater.py
index 6844b09..367ba43 100644
--- a/src/resource_inventory/pdf_templater.py
+++ b/src/resource_inventory/pdf_templater.py
@@ -101,7 +101,7 @@ class PDFTemplater:
returns a dictionary
"""
host_info = {}
- host_info['name'] = host.template.resource.name
+ host_info['name'] = host.name
host_info['node'] = cls.get_pdf_host_node(host)
host_info['disks'] = []
for disk in host.profile.storageprofile.all():
@@ -153,13 +153,8 @@ class PDFTemplater:
iface_info = {}
iface_info['features'] = "none"
iface_info['mac_address'] = interface.mac_address
- iface_info['name'] = interface.name
- speed = "unknown"
- try:
- profile = InterfaceProfile.objects.get(host=interface.host.profile, name=interface.name)
- speed = str(int(profile.speed / 1000)) + "gb"
- except Exception:
- pass
+ iface_info['name'] = interface.profile.name
+ speed = str(int(interface.profile.speed / 1000)) + "gb"
iface_info['speed'] = speed
return iface_info