printing: fail-proof sur hptools

This commit is contained in:
Daniel STAN 2015-06-17 10:20:54 +02:00
parent 8698895a87
commit fc07577c07

View file

@ -59,6 +59,8 @@ def prise_etat(chbre):
switch = hptools2.HPSwitch(switch_name) switch = hptools2.HPSwitch(switch_name)
except hptools2.SwitchNotFound: except hptools2.SwitchNotFound:
return style(u"Meh, le switch %s ne répond pas ou n'existe pas." % (switch_name,), "violet") 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) vlan_list = switch.get_vlans(port)
vlans = u" " * (13 + len(chbre)) vlans = u" " * (13 + len(chbre))