[1]Check User Password </br>


####Check User Password####

import passlib.hash

CONF.crypt_strength = 4000

def trunc_password(password):
"""Truncate passwords to the MAX_PASSWORD_LENGTH."""
if len(password) > MAX_PASSWORD_LENGTH:
return password[:MAX_PASSWORD_LENGTH]
else:
return password


def 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 h


def 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####

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