remove improper usage of 'assert'
remove improper usage of 'assert'

The assert will not raise AssertionError when run Python with '-O' flag.
And at the same time, any program should have a same result with or
without '-O' flag. So we could use assert to check some rare condition,
but we couldn't use it in logic flow or except it must raise an
Assertionerror, for example:

this is not bad:

def func(fname):
    assert os.path.exist(fname)
    f = open(fname)
    ...

but this will have different results with or without '-O' flag

def func(num):
    try:
        assert num is 5
    except: Assertionerror:
        log.error("your number isn't 5!")

The second case is what I fixes in this patch.

fixes bug #1199354
Change-Id: I20e83ecfc181d213f357aa74e0af3a110526904c

scripnichenko/nova,klmitch/nova,blueboxgroup/nova,alvarolopez/nova,rrader/nova-docker-plugin,JioCloud/nova_test_latest,jeffrey4l/nova,plumgrid/plumgrid-nova,apporc/nova,joker946/nova,joker946/nova,zhimin711/nova,rajalokan/nova,Metaswitch/calico-nova,noironetworks/nova,virtualopensystems/nova,plumgrid/plumgrid-nova,orbitfp7/nova,kimjaejoong/nova,zaina/nova,cernops/nova,klmitch/nova,belmiromoreira/nova,eonpatapon/nova,NeCTAR-RC/nova,mahak/nova,akash1808/nova,eonpatapon/nova,CloudServer/nova,ruslanloman/nova,citrix-openstack-build/nova,imsplitbit/nova,luogangyi/bcec-nova,fnordahl/nova,bigswitch/nova,watonyweng/nova,mahak/nova,cloudbase/nova-virtualbox,openstack/nova,citrix-openstack-build/nova,kimjaejoong/nova,sacharya/nova,angdraug/nova,silenceli/nova,dawnpower/nova,takeshineshiro/nova,mmnelemane/nova,CEG-FYP-OpenStack/scheduler,hanlind/nova,mandeepdhami/nova,zhimin711/nova,shail2810/nova,Yusuke1987/openstack_template,virtualopensystems/nova,leilihh/nova,gooddata/openstack-nova,SUSE-Cloud/nova,rajalokan/nova,CiscoSystems/nova,cloudbase/nova-virtualbox,ruslanloman/nova,vmturbo/nova,projectcalico/calico-nova,tealover/nova,blueboxgroup/nova,cloudbau/nova,MountainWei/nova,tangfeixiong/nova,JioCloud/nova,sebrandon1/nova,tudorvio/nova,yatinkumbhare/openstack-nova,berrange/nova,nikesh-mahalka/nova,jeffrey4l/nova,gooddata/openstack-nova,alexandrucoman/vbox-nova-driver,eayunstack/nova,shahar-stratoscale/nova,klmitch/nova,akash1808/nova_test_latest,petrutlucian94/nova_dev,TieWei/nova,jianghuaw/nova,CEG-FYP-OpenStack/scheduler,openstack/nova,openstack/nova,vladikr/nova_drafts,varunarya10/nova_test_latest,Yuriy-Leonov/nova,hanlind/nova,Francis-Liu/animated-broccoli,phenoxim/nova,ntt-sic/nova,OpenAcademy-OpenStack/nova-scheduler,TieWei/nova,isyippee/nova,bclau/nova,SUSE-Cloud/nova,JianyuWang/nova,mgagne/nova,takeshineshiro/nova,bclau/nova,dims/nova,cloudbase/nova,ewindisch/nova,double12gzh/nova,petrutlucian94/nova,JioCloud/nova_test_latest,thomasem/nova,scripnichenko/nova,eayunstack/nova,jianghuaw/nova,zzicewind/nova,varunarya10/nova_test_latest,BeyondTheClouds/nova,isyippee/nova,rahulunair/nova,shail2810/nova,mmnelemane/nova,rahulunair/nova,devendermishrajio/nova,rajalokan/nova,Stavitsky/nova,ewindisch/nova,edulramirez/nova,thomasem/nova,LoHChina/nova,petrutlucian94/nova,watonyweng/nova,vmturbo/nova,saleemjaveds/https-github.com-openstack-nova,devendermishrajio/nova_test_latest,j-carpentier/nova,rickerc/nova_audit,badock/nova,rahulunair/nova,cyx1231st/nova,apporc/nova,rrader/nova-docker-plugin,Juniper/nova,ntt-sic/nova,devendermishrajio/nova_test_latest,belmiromoreira/nova,whitepages/nova,vladikr/nova_drafts,mgagne/nova,affo/nova,rajalokan/nova,raildo/nova,redhat-openstack/nova,Juniper/nova,TwinkleChawla/nova,eharney/nova,cloudbau/nova,Juniper/nova,OpenAcademy-OpenStack/nova-scheduler,tangfeixiong/nova,CCI-MOC/nova,cernops/nova,jianghuaw/nova,jianghuaw/nova,Yusuke1987/openstack_template,iuliat/nova,mikalstill/nova,cyx1231st/nova,Yuriy-Leonov/nova,dawnpower/nova,felixma/nova,Juniper/nova,klmitch/nova,mandeepdhami/nova,CloudServer/nova,NeCTAR-RC/nova,JianyuWang/nova,sebrandon1/nova,BeyondTheClouds/nova,iuliat/nova,dims/nova,leilihh/novaha,TwinkleChawla/nova,gooddata/openstack-nova,JioCloud/nova,silenceli/nova,fnordahl/nova,Stavitsky/nova,badock/nova,projectcalico/calico-nova,leilihh/nova,imsplitbit/nova,raildo/nova,vmturbo/nova,whitepages/nova,zzicewind/nova,gooddata/openstack-nova,berrange/nova,shahar-stratoscale/nova,tealover/nova,CiscoSystems/nova,alexandrucoman/vbox-nova-driver,LoHChina/nova,adelina-t/nova,tianweizhang/nova,alaski/nova,phenoxim/nova,yatinkumbhare/openstack-nova,spring-week-topos/nova-week,maelnor/nova,barnsnake351/nova,spring-week-topos/nova-week,devendermishrajio/nova,tanglei528/nova,mahak/nova,zaina/nova,saleemjaveds/https-github.com-openstack-nova,tanglei528/nova,petrutlucian94/nova_dev,Metaswitch/calico-nova,viggates/nova,tianweizhang/nova,luogangyi/bcec-nova,maelnor/nova,Tehsmash/nova,redhat-openstack/nova,cernops/nova,MountainWei/nova,orbitfp7/nova,vmturbo/nova,BeyondTheClouds/nova,cloudbase/nova,hanlind/nova,sebrandon1/nova,alvarolopez/nova,noironetworks/nova,alaski/nova,ted-gould/nova,eharney/nova,bgxavier/nova,viggates/nova,bgxavier/nova,akash1808/nova_test_latest,j-carpentier/nova,bigswitch/nova,mikalstill/nova,cloudbase/nova,adelina-t/nova,CCI-MOC/nova,yosshy/nova,double12gzh/nova,akash1808/nova,Francis-Liu/animated-broccoli,ted-gould/nova,sacharya/nova,devoid/nova,tudorvio/nova,nikesh-mahalka/nova,devoid/nova,rickerc/nova_audit,mikalstill/nova,edulramirez/nova,leilihh/novaha,yosshy/nova,angdraug/nova,felixma/nova,Tehsmash/nova,barnsnake351/nova,affo/nova