print more info about the execptions
This commit is contained in:
parent
4b059c1e68
commit
52b13ce671
1 changed files with 6 additions and 3 deletions
9
main.py
9
main.py
|
@ -191,8 +191,9 @@ class Switch:
|
|||
if "hp" in constructor or "aruba" in constructor:
|
||||
self.gen_conf_hp()
|
||||
self.write_conf()
|
||||
except RuntimeError:
|
||||
except RuntimeError as e:
|
||||
print("Il y a eu une erreur pour le switch %s, la config proposée n'est pas intègre" % self.switch["short_name"])
|
||||
print(e)
|
||||
|
||||
def apply_conf(self):
|
||||
if self.check_and_get_login():
|
||||
|
@ -217,8 +218,9 @@ class Switch:
|
|||
if self.primary_firmware < self.switch["firmware"]:
|
||||
self.upgrade_hp()
|
||||
# self.reboot_hp()
|
||||
except RuntimeError:
|
||||
except RuntimeError as e:
|
||||
print("Il y a eu une erreur pour la mise à jour du switch" + self.switch["short_name"])
|
||||
print(e)
|
||||
|
||||
def get_firmware_hp(self):
|
||||
# L'URI est positionnée dans une variable
|
||||
|
@ -296,8 +298,9 @@ if "--force" in sys.argv:
|
|||
sw.gen_conf_and_write()
|
||||
try:
|
||||
sw.apply_conf()
|
||||
except:
|
||||
except Exception as e:
|
||||
print("Erreur dans l'application de la conf pour " + switch["short_name"])
|
||||
print(e)
|
||||
|
||||
|
||||
if "--upgrade" in sys.argv:
|
||||
|
|
Loading…
Reference in a new issue