diff options
Diffstat (limited to 'src/resource_inventory')
-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 |