Fix local variable 'root_uuid' ref before assign
Fix local variable 'root_uuid' ref before assign

Fixes an issue where the root_uuid variable gets used
before it is assigned.

This moves the switch_pxe_config function so that it only gets
called if root_uuid is assigned.

Fixes LP Bug #1190269.

Change-Id: I1abaf391f3a80dcacc815d2e38c6da9ad1b099ff

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