lib/gettor/utils.py
def verifyPassword(conf, password):
    """Verify that a given password matches the one provided in the
       password file
    """
    candidateHash = str(hashlib.sha1(password).hexdigest())
    try:
        passFile = os.path.join(conf.BASEDIR, conf.PASSFILE)
        fd = open(passFile, 'r')
        passwordHash = fd.read()
        fd.close
        if candidateHash == passwordHash:
            logging.debug("Verification succeeded")
            return True
        else:
            logging.error("Verification failed")
            return False
    except Exception as e:
        logging.error("Verifying password failed: %s" % e)
        return False
Verify that a given password matches the one provided in the
       password file
    
Verify that a given password matches the one provided in the
password file
Verify that a given password matches the one provided in the password file
def verifyPassword(conf, password):
    candidateHash = str(hashlib.sha1(password).hexdigest())
    try:
        passFile = os.path.join(conf.BASEDIR, conf.PASSFILE)
        fd = open(passFile, 'r')
        passwordHash = fd.read()
        fd.close
        if candidateHash == passwordHash:
            logging.debug("Verification succeeded")
            return True
        else:
            logging.error("Verification failed")
            return False
    except Exception as e:
        logging.error("Verifying password failed: %s" % e)
        return False
def verifyPassword ( conf , password ) : candidateHash = str ( hashlib . sha1 ( password ) . hexdigest ( ) ) try : passFile = os . path . join ( conf . BASEDIR , conf . PASSFILE ) fd = open ( passFile , 'r' ) passwordHash = fd . read ( ) fd . close if candidateHash == passwordHash : logging . debug ( "Verification succeeded" ) return True else : logging . error ( "Verification failed" ) return False except Exception as e : logging . error ( "Verifying password failed: %s" % e ) return False
Verify that a given password matches the one provided in the
password file
Verify that a given password matches the one provided in the password file
"""Verify that a given password matches the one provided in the
       password file
    """
conf
password