From 7282289e63a9c2f5072b205cf41b8e979fd1d7e0 Mon Sep 17 00:00:00 2001 From: Sawyer Bergeron Date: Mon, 12 Oct 2020 16:51:35 -0400 Subject: Add helper functions for booking specific hosts Signed-off-by: Sawyer Bergeron Change-Id: Ib651a00ffb4e0aca9004397a61835cde01f6ccf3 Signed-off-by: Sawyer Bergeron --- src/resource_inventory/pdf_templater.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/resource_inventory') diff --git a/src/resource_inventory/pdf_templater.py b/src/resource_inventory/pdf_templater.py index 86d84aa..c4b22fe 100644 --- a/src/resource_inventory/pdf_templater.py +++ b/src/resource_inventory/pdf_templater.py @@ -22,7 +22,11 @@ class PDFTemplater: template = "dashboard/pdf.yaml" info = {} info['details'] = cls.get_pdf_details(booking.resource) - info['jumphost'] = cls.get_pdf_jumphost(booking) + try: + info['jumphost'] = cls.get_pdf_jumphost(booking) + except Exception: + # filling in jumphost info can be optional in some cases, this shouldn't be a hard error + info['jumphost'] = {} info['nodes'] = cls.get_pdf_nodes(booking) return render_to_string(template, context=info) -- cgit 1.2.3-korg