printing: fail-proof sur hptools
This commit is contained in:
parent
8698895a87
commit
fc07577c07
1 changed files with 2 additions and 0 deletions
|
@ -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))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue