[switchs] ajout d'une option header pour ne pas avoir besoin de se connecter au switch pour générer une conf correcte...

darcs-hash:20101022230056-ffbb2-a6f72dd8ba1ed10bc7d89cf630ad85948aed1d30.gz
This commit is contained in:
Nicolas Dandrimont 2010-10-23 01:00:56 +02:00
parent 4b5fbee836
commit 3d1d0300ec

View file

@ -299,6 +299,11 @@ exit
old_config.close()
self.aff.cycle()
elif '--header' in options:
for opt, arg in opts:
if opt == '--header':
params['switch_config_header'] = arg
break
else:
params['switch_config_header']= '; J4899A Configuration Editor; Created on release #H.10.50'
@ -521,7 +526,7 @@ aaa port-access mac-based %(prise)s unauth-vid 1
fd.close()
if __name__ == '__main__' :
opts, args = getopt.getopt(sys.argv[1:], 'hga', ['get-conf', 'help', 'all'])
opts, args = getopt.getopt(sys.argv[1:], 'hga', ['get-conf', 'help', 'all', 'header=' ])
if '-h' in sys.argv or '--help' in sys.argv or len(sys.argv) == 1 :
print "%s [-g|--get-conf] <switch>" % sys.argv[0].split('/')[-1].split('.')[0]
print "Génération du fichier de configuration des switchs donnés."