Make strutils.mask_password more secure
Make strutils.mask_password more secure

Make some enhancements to strutils.mask_password to allow it to
catch more cases of passwords in strings.

The following is a listing of patterns that will be handled. The
keyword that mask_password uses (a list of four now) is represented
by <key> and the password is shown as <password>. Quotes (both single
and double) are represented as <quote>.

--<key> <password>
--<key> <quote><password><quote>
<key> = <password>
<key> = <quote><password><quote>

All existing tests and patterns are still handled.

Cherry-pick from review.openstack.org/113407
Partial-Bug: #1345233

Change-Id: I693baaf225c5b393401d499d14f271cadb63eb2c

petrutlucian94/nova,badock/nova,vmturbo/nova,BeyondTheClouds/nova,cernops/nova,dawnpower/nova,projectcalico/calico-nova,bigswitch/nova,openstack/nova,maelnor/nova,klmitch/nova,mmnelemane/nova,thomasem/nova,Stavitsky/nova,mandeepdhami/nova,hanlind/nova,redhat-openstack/nova,cloudbase/nova-virtualbox,tianweizhang/nova,MountainWei/nova,openstack/nova,isyippee/nova,tianweizhang/nova,mikalstill/nova,yosshy/nova,bgxavier/nova,yosshy/nova,angdraug/nova,takeshineshiro/nova,eonpatapon/nova,cernops/nova,mikalstill/nova,CloudServer/nova,MountainWei/nova,j-carpentier/nova,orbitfp7/nova,devendermishrajio/nova_test_latest,jianghuaw/nova,alaski/nova,zzicewind/nova,berrange/nova,tudorvio/nova,phenoxim/nova,zaina/nova,eayunstack/nova,CloudServer/nova,barnsnake351/nova,nikesh-mahalka/nova,orbitfp7/nova,iuliat/nova,barnsnake351/nova,dims/nova,yatinkumbhare/openstack-nova,bigswitch/nova,BeyondTheClouds/nova,mahak/nova,thomasem/nova,jeffrey4l/nova,rahulunair/nova,devendermishrajio/nova,Tehsmash/nova,jianghuaw/nova,jianghuaw/nova,TwinkleChawla/nova,raildo/nova,eayunstack/nova,badock/nova,noironetworks/nova,bgxavier/nova,takeshineshiro/nova,Juniper/nova,sebrandon1/nova,tealover/nova,j-carpentier/nova,ted-gould/nova,Metaswitch/calico-nova,yatinkumbhare/openstack-nova,alexandrucoman/vbox-nova-driver,mgagne/nova,silenceli/nova,zhimin711/nova,zzicewind/nova,mahak/nova,JioCloud/nova,devendermishrajio/nova,ted-gould/nova,NeCTAR-RC/nova,Juniper/nova,gooddata/openstack-nova,Juniper/nova,JioCloud/nova,zhimin711/nova,rahulunair/nova,tangfeixiong/nova,Tehsmash/nova,adelina-t/nova,whitepages/nova,varunarya10/nova_test_latest,ruslanloman/nova,Juniper/nova,scripnichenko/nova,CCI-MOC/nova,zaina/nova,belmiromoreira/nova,cernops/nova,akash1808/nova,klmitch/nova,kimjaejoong/nova,joker946/nova,edulramirez/nova,vladikr/nova_drafts,JioCloud/nova_test_latest,tealover/nova,akash1808/nova_test_latest,isyippee/nova,double12gzh/nova,edulramirez/nova,eonpatapon/nova,vladikr/nova_drafts,TwinkleChawla/nova,dawnpower/nova,rajalokan/nova,Francis-Liu/animated-broccoli,NeCTAR-RC/nova,akash1808/nova,JianyuWang/nova,cloudbase/nova,JianyuWang/nova,angdraug/nova,devendermishrajio/nova_test_latest,gooddata/openstack-nova,berrange/nova,projectcalico/calico-nova,cloudbase/nova,alvarolopez/nova,openstack/nova,watonyweng/nova,vmturbo/nova,cyx1231st/nova,affo/nova,JioCloud/nova_test_latest,sebrandon1/nova,akash1808/nova_test_latest,BeyondTheClouds/nova,sebrandon1/nova,rahulunair/nova,adelina-t/nova,petrutlucian94/nova,nikesh-mahalka/nova,rajalokan/nova,whitepages/nova,rajalokan/nova,blueboxgroup/nova,Yusuke1987/openstack_template,watonyweng/nova,scripnichenko/nova,redhat-openstack/nova,shail2810/nova,double12gzh/nova,cloudbase/nova,fnordahl/nova,klmitch/nova,hanlind/nova,Yusuke1987/openstack_template,dims/nova,ruslanloman/nova,vmturbo/nova,klmitch/nova,gooddata/openstack-nova,gooddata/openstack-nova,raildo/nova,belmiromoreira/nova,kimjaejoong/nova,CCI-MOC/nova,mahak/nova,affo/nova,Metaswitch/calico-nova,phenoxim/nova,maelnor/nova,mgagne/nova,cyx1231st/nova,fnordahl/nova,Stavitsky/nova,iuliat/nova,mmnelemane/nova,rajalokan/nova,blueboxgroup/nova,mandeepdhami/nova,hanlind/nova,apporc/nova,vmturbo/nova,joker946/nova,LoHChina/nova,alexandrucoman/vbox-nova-driver,noironetworks/nova,varunarya10/nova_test_latest,mikalstill/nova,apporc/nova,Francis-Liu/animated-broccoli,tangfeixiong/nova,jeffrey4l/nova,silenceli/nova,jianghuaw/nova,shail2810/nova,alaski/nova,felixma/nova,alvarolopez/nova,tudorvio/nova,CEG-FYP-OpenStack/scheduler,CEG-FYP-OpenStack/scheduler,felixma/nova,LoHChina/nova,cloudbase/nova-virtualbox