def _maybe_encrypt_password(role,
                            password,
                            encrypted=_DEFAULT_PASSWORDS_ENCRYPTION):
    if password is not None:
        password = str(password)
    if encrypted and password and not password.startswith('md5'):
        password = "md5{0}".format(
            hashlib.md5(salt.utils.to_bytes('{0}{1}'.format(password, role))).hexdigest())
    return password
Write request.hooks to the cherrypy error log.
dataset/ETHPy150Open saltstack/salt/salt/modules/postgres.py/_maybe_encrypt_password--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/cherrypy/cherrypy/lib/cptools.py/log_hooks