From fc07577c078f1c4dbc812244b8bc786f53458bb3 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Wed, 17 Jun 2015 10:20:54 +0200 Subject: [PATCH] printing: fail-proof sur hptools --- printing/templates/templates.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/printing/templates/templates.py b/printing/templates/templates.py index e4a4aee..8f4fe6b 100644 --- a/printing/templates/templates.py +++ b/printing/templates/templates.py @@ -59,6 +59,8 @@ def prise_etat(chbre): switch = hptools2.HPSwitch(switch_name) except hptools2.SwitchNotFound: return style(u"Meh, le switch %s ne répond pas ou n'existe pas." % (switch_name,), "violet") + except Exception as e: + return style(u"hptools2 failed (%r)" % e, "rouge") vlan_list = switch.get_vlans(port) vlans = u" " * (13 + len(chbre))