Avoid extra glance v2 locations call!
Avoid extra glance v2 locations call!

In 7df1c911 we added code to attempt to direct download
images from glance locations. This feature is meant to be off
by default however when it is disabled it adds an unnecessary
glance V2 API call.

This patch removes the extra get_locations call when
CONF.allowed_direct_url_schemes is empty (disabled). This effectively
fixes Nova on Python some 2.6 distros which fail to work with the
recent Glance V2 schema code.

Fixes LP Bug #1208656

Change-Id: I0989ed4f248cd1126d4703ad6498cfd66685ae31

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