Detabification massive.
darcs-hash:20051018083823-d1718-09c2df38cfb707d3c3679188b9b9a812009f4f7c.gz
This commit is contained in:
parent
3c54fb2904
commit
37b21339a6
40 changed files with 1473 additions and 1473 deletions
|
@ -387,7 +387,7 @@ if __name__ == '__main__' :
|
|||
except getopt.error, msg :
|
||||
print msg
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
cmds = []
|
||||
firmware=''
|
||||
for opt, val in options :
|
||||
|
@ -395,28 +395,28 @@ if __name__ == '__main__' :
|
|||
print "Usage : %s [[-c commande1] -c commande2...] [-U firmware] regex "
|
||||
print "Envoi les commandes données au switchs matchant la regex"
|
||||
print "si aucune commande est founie lit l'entree standart"
|
||||
print "L'envoi de firmware ne fait pas rebooter le switch"
|
||||
print "L'envoi de firmware ne fait pas rebooter le switch"
|
||||
sys.exit(0)
|
||||
|
||||
elif opt=='-c' :
|
||||
cmds.append(val)
|
||||
|
||||
elif opt=='-U' :
|
||||
firmware=val
|
||||
|
||||
|
||||
elif opt=='-U' :
|
||||
firmware=val
|
||||
|
||||
# Quels switchs ?
|
||||
switchs=[]
|
||||
if arg :
|
||||
re=sre.compile(arg[0])
|
||||
for sw in all_switchs() :
|
||||
if re.match(sw) :
|
||||
switchs.append(sw)
|
||||
|
||||
re=sre.compile(arg[0])
|
||||
for sw in all_switchs() :
|
||||
if re.match(sw) :
|
||||
switchs.append(sw)
|
||||
|
||||
if not switchs :
|
||||
print "Aucun switch trouvé"
|
||||
print "Note : il faut une _regex_ (!= wilcards au sens du shell)"
|
||||
sys.exit(3)
|
||||
|
||||
print "Aucun switch trouvé"
|
||||
print "Note : il faut une _regex_ (!= wilcards au sens du shell)"
|
||||
sys.exit(3)
|
||||
|
||||
if not cmds and not firmware :
|
||||
cmds=map(str.strip,sys.stdin.readlines())
|
||||
|
||||
|
@ -429,13 +429,13 @@ if __name__ == '__main__' :
|
|||
|
||||
for sw in switchs :
|
||||
print sw
|
||||
try:
|
||||
try:
|
||||
# Au cas ou le switch ne répondrai pas
|
||||
s = hpswitch(sw)
|
||||
if firmware :
|
||||
s.upgrade(firmware)
|
||||
if firmware :
|
||||
s.upgrade(firmware)
|
||||
for cmd in cmds :
|
||||
print s.send_cmd(cmd)
|
||||
except :
|
||||
print 'ERREUR'
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue