diff --git a/gestion/gen_confs/switchs.py b/gestion/gen_confs/switchs.py index 327fd97e..7160bc67 100755 --- a/gestion/gen_confs/switchs.py +++ b/gestion/gen_confs/switchs.py @@ -486,16 +486,16 @@ 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']) + opts, args = getopt.getopt(sys.argv[1:], 'hga', ['get-conf', 'help', 'all']) if '-h' in sys.argv or '--help' in sys.argv or len(sys.argv) == 1 : print "%s [-g|--get-conf] " % sys.argv[0].split('/')[-1].split('.')[0] print "Génération du fichier de configuration des switchs donnés." sys.exit(255) - if sys.argv[1] == 'all' : + if args[0] == 'all' or 'a' in opts or '--all' in opts : switchs = tuple(all_switchs()) else : - switchs = tuple(sys.argv[1:]) + switchs = tuple(args) sw = switch(switchs) sw.debug = 1 sw.reconfigure()