Neutron: simplify validate_networks
Neutron: simplify validate_networks

Creates a utility method that returns the number of ports required
by an instance. This does the following:
1. it simplifies the method
2. reduce the complexity of the code
'./nova/network/neutronv2/api.py:913:1: C901 'API.validate_networks' is too complex (25)'

NOTE: the code is already tested and this is just moving the internals.

Change-Id: Ibed04a7f10eb85198c7d3ac2cedb58f50ec11f5e

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