openstack code snippets keystone July 30, 2013 [1]Check User Password </br> ####Check User Password#### import passlib.hashCONF.crypt_strength = 4000def trunc_password(password): """Truncate passwords to the MAX_PASSWORD_LENGTH.""" if len(password) > MAX_PASSWORD_LENGTH: return password[:MAX_PASSWORD_LENGTH] else: return passworddef hash_password(password): """Hash a password. Hard.""" password_utf8 = password.encode('utf-8') if passlib.hash.sha512_crypt.identify(password_utf8): return password_utf8 h = passlib.hash.sha512_crypt.encrypt(password_utf8, rounds=CONF.crypt_strength) return hdef check_password(password, hashed): """Check that a plaintext password matches hashed. hashpw returns the salt value concatenated with the actual hash value. It extracts the actual salt if this value is then passed as the salt. """ if password is None: return False password_utf8 = password.encode('utf-8') return passlib.hash.sha512_crypt.verify(password_utf8, hashed) ####Looping Call#### Read More OpenStack Projects Overview ### Openstack Service Projects(Ocata)>https://releases.openstack.org/ocata/index.html#### `aodh `> ceilometer alarming [github](https:/...… Continue reading hands on nova aggregates Published on February 20, 2017 How to use cloud-init Published on October 08, 2016