Generate consistent length passwords in AIO
Generate consistent length passwords in AIO

The bootstrap-aio.sh script generates a password by reading a set number
of characters from urandom then removing those that aren't alphanumeric.
The problem with this is that its possible for 0 characters to remain.

This patch changes the order so that tr (translate) reads urandom
directly and removes non alphanumeric characters then that output is
truncated to the required length. This ensures the generated password is
always the desired length.

Change-Id: I03984ab891f88fe4b064f7f7fcb71edf48096493
Closes-Bug: #1465684

achekunov/openstack-ansible,sti-jans/openstack-ansible,openstack/openstack-ansible,jpmontez/openstack-ansible,sigmavirus24/openstack-ansible,jpmontez/os-ansible-deployment,open-switch/infra_openstack-ansible,yanyao/openstack-deployment-liberty,shane-c/openstack-ansible,AlphaStaxLLC/os-ansible-deployment,jpmontez/openstack-ansible,major/os-ansible-deployment,AlphaStaxLLC/os-ansible-deployment,sigmavirus24/os-ansible-deployment,cloudnull/os-ansible-deployment,pombredanne/os-ansible-deployment,cfarquhar/openstack-ansible,antonym/openstack-ansible,BjoernT/openstack-ansible,bunchc/openstack-ansible,mancdaz/openstack-ansible,stackforge/os-ansible-deployment,BjoernT/os-ansible-deployment,wenhuizhang/os-ansible-deployment,BjoernT/openstack-ansible,major/os-ansible-deployment,pombredanne/os-ansible-deployment,robb-romans/openstack-ansible,Logan2211/openstack-ansible,robb-romans/openstack-ansible,mancdaz/openstack-ansible,major/openstack-ansible,major/openstack-ansible,antonym/openstack-ansible,antonym/openstack-ansible,open-switch/infra_openstack-ansible,yanyao/openstack-ansible,manuelfelipe/openstack-ansible,git-harry/os-ansible-deployment,yanyao/newton,miguelgrinberg/os-ansible-deployment,git-harry/os-ansible-deployment,yanyao/openstack-deployment-liberty,os-cloud/os-ansible-deployment,mrda/openstack-ansible,wenhuizhang/os-ansible-deployment,sti-jans/openstack-ansible,openstack/openstack-ansible,stackforge/os-ansible-deployment,jpmontez/openstack-ansible,manuelfelipe/openstack-ansible,pombredanne/os-ansible-deployment,sacharya/os-ansible-deployment,shane-c/openstack-ansible,dhanunjaya/os-ansible-deployment,bunchc/openstack-ansible,manuelfelipe/openstack-ansible,jpmontez/os-ansible-deployment,git-harry/os-ansible-deployment,yanyao/openstack-deployment-liberty,yanyao/openstack-ansible,achekunov/openstack-ansible,shane-c/openstack-ansible,weezer/openstack-ansible,cloudnull/os-ansible-deployment,os-cloud/os-ansible-deployment,sigmavirus24/openstack-ansible,BjoernT/os-ansible-deployment,jpmontez/os-ansible-deployment,sti-jans/openstack-ansible,weezer/openstack-ansible,sacharya/os-ansible-deployment,yanyao/newton,AlphaStaxLLC/os-ansible-deployment,cfarquhar/openstack-ansible,dhanunjaya/os-ansible-deployment,Logan2211/openstack-ansible,sigmavirus24/os-ansible-deployment,achekunov/openstack-ansible,open-switch/infra_openstack-ansible,miguelgrinberg/os-ansible-deployment,mrda/openstack-ansible,mrda/openstack-ansible,BjoernT/os-ansible-deployment