Example #1
0
        '-c'        : 'commit',
        '--commit'  : 'commit',
    
        '-h'        : 'help',
        '--help'    : 'help',

        '--threads' : 'threads=',
        '--quiet'   : 'quiet',
        '--randomize': 'randomize',
        
        '-v'        : 'verbose',
        '--verbose' : 'verbose'
    }
    
    # grab arguments
    lists, options = util.parseArgs( args )
    
    # parse options
    if (options.has_key( 'help' ) and options['help'] == 1) or len(lists) < 1:
        usage( None )
        sys.exit()
            
    # parse rest of arguments
    options = parseArguments( options )

    # get the passwords to set
    options = util.parsePasswords( options )

    # create the manager and add the list of hosts
    manager = PasswordManager( PasswordWorker, config_file, options=options, num_threads=options['threads'] )
    manager.append( lists )
Example #2
0
        
        '-v'        : 'verbose',
        '--verbose' : 'verbose'

    }

    def append_scrubs( orig, klass ):
        for i in klass.scrub_matches:
            orig.scrub_matches.append( i )
        # logging.error("I: %s" % (orig.scrub_matches,))
        return orig
    
    #logging.basicConfig(level=logging.DEBUG)
    
    # parse arguments
    files, options = util.parseArgs( args )

    if (options.has_key( 'help' ) and options['help'] == 1) or len(files) < 1:
        usage()
        sys.exit( )

    # inheritors of backup configuration
    logging.error( '%s' % inheritors( 'netconfig.backup.configuration' )

    sys.exit(1)
    for f in files:
        # logging.info("FILE %s" % (f,)  )

        fn = open( f, 'r' )
        this = []
        for l in fn.readlines():