diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2019-05-09 17:12:27 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2019-05-09 17:12:27 +0000 |
commit | 541473c28a3af6661b1971bf4d35e1da5b9a1c23 (patch) | |
tree | 89f7687fce294f91ec1fef6808a1303f33a47db2 /src/resource_inventory/pdf_templater.py | |
parent | 48cff65180d0584bdd0f60a4226bd36511f36161 (diff) | |
parent | ae15c9c6702ec5e8af44d72c5a37eaefee27a0d8 (diff) |
Merge "Allow query to fail"
Diffstat (limited to 'src/resource_inventory/pdf_templater.py')
-rw-r--r-- | src/resource_inventory/pdf_templater.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/resource_inventory/pdf_templater.py b/src/resource_inventory/pdf_templater.py index d08b303..2302530 100644 --- a/src/resource_inventory/pdf_templater.py +++ b/src/resource_inventory/pdf_templater.py @@ -168,8 +168,13 @@ class PDFTemplater: iface_info['features'] = "none" iface_info['mac_address'] = interface.mac_address iface_info['name'] = interface.name - profile = InterfaceProfile.objects.get(host=interface.host.profile, name=interface.name) - iface_info['speed'] = str(int(profile.speed / 1000)) + "gb" + 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['speed'] = speed return iface_info @classmethod |