def getPassword(username, retries = 3):
     import getpass
     from CMGTools.Production.findDSOnSav import validLogin
     
     password = None
     for i in xrange(retries):
         pw = getpass.getpass("Enter NICE Password [%d/%d] for user '%s': " % (i+1,retries,username) )
         if validLogin(username, pw):
             password = pw
             break
         else:
             print >> sys.stderr, 'Password incorrect. %d retries left...' % (retries-(i+1))
     return password
Exemple #2
0
    def getPassword(username, retries=3):
        import getpass
        from CMGTools.Production.findDSOnSav import validLogin

        password = None
        for i in xrange(retries):
            pw = getpass.getpass(
                "Enter NICE Password [%d/%d] for user '%s': " %
                (i + 1, retries, username))
            if validLogin(username, pw):
                password = pw
                break
            else:
                print >> sys.stderr, 'Password incorrect. %d retries left...' % (
                    retries - (i + 1))
        return password
    (options, args) = parser.parse_args()
    if len(args) != 1:
        parser.print_help()
        sys.exit(-1)

    if options.password == None:
        try:
            password = getpass.getpass("Enter NICE Password: "******"Authentication Failed, exiting\n\n"
            sys.exit(1)
        options.password = password
    else:
        password = options.password

    if not validLogin(options.username, password):
        print "Authentication Failed, exiting\n\n"
        sys.exit(-1)

    dir_name = args[0]
    valRunInfo = getValidationRunInfoFromDisk(dir_name)
    valRunInfo.printComponents()
    valRunInfo.printAnalyzers()
    valRunInfo.printReleaseInfo()
    valRunInfo.printRootFilesInfo()
    addInformationToCMGDB(dir_name, valRunInfo, options.development)
    persistentObject = anydbm.open("self.db", 'n')
    persistentObject.close()
    persistentObject = shelve.open("self.db")
    persistentObject["valRunInfo"] = valRunInfo
    persistentObject.close()
Exemple #4
0
 def loginValid(self):
     """Returns true if the login values that the user provided were a valid CMG group NICE login"""
     return findDSOnSav.validLogin(self._username, self._password)
Exemple #5
0
 
 (options, args) = parser.parse_args()
 
 # Allow no more than one argument
 if len(args)!=1:
     parser.print_help()
     sys.exit(1)
     
 if options.password == None:
     try:
 	    password = getpass.getpass("Enter NICE Password: "******"Authentication Failed, exiting\n\n"
 	    sys.exit(1)
 	options.password = password
 if not validLogin(options.username, password):
 	print "Authentication Failed, exiting\n\n"
 	sys.exit(1)
 
 
 
 # For multiple file input
 if options.multi:
     file = open(args[0], 'r')
     lines = file.readlines()
     for line in lines:
         line = re.sub("\s+", " ", line)
         try:
         	
             dataset = line.split(" ")[0].lstrip().rstrip()
             fileown = options.fileown
Exemple #6
0
 def loginValid(self):
     """Returns true, if the login values provided
     by the user were a valid CMG NICE login"""
     return findDSOnSav.validLogin(self._username,
                                   self._password)
	def loginValid(self):
		"""Returns true if the login values that the user provided were a valid CMG group NICE login"""
		return findDSOnSav.validLogin(self._username, self._password)