diff --git a/printing/templates/templates.py b/printing/templates/templates.py index de5c3eb..59143aa 100644 --- a/printing/templates/templates.py +++ b/printing/templates/templates.py @@ -62,6 +62,8 @@ def prise_etat(chbre): except Exception as e: return style(u"hptools2 failed (%r)" % e, "rouge") vlan_list = switch.get_vlans(port) + if vlan_list is None: + return style(u"vlan_list is empty (hptools failed ?)", "rouge") vlans = u" " * (13 + len(chbre)) vlans += u"Vlan%s : " % (u's' if len(vlan_list) > 1 else u"",) + style(u", ".join([unicode(vlan) for vlan in vlan_list]), "orange")