Ensure test_models_sync() works with new Alembic releases
Ensure test_models_sync() works with new Alembic releases

test_models_sync() test is currently making assuptions about Alembic,
which might not be true in the upcoming releases: e.g. Column object
will not necessarily be bound to a Table instance.

Fix this by using the format described at:

http://alembic.readthedocs.org/en/rel_0_7/api.html#alembic.autogenerate.compare_metadata

Also, the code has been refactored a bit, so that we don't have to go
over a list of differences multiple times and it's not changed in-place
anymore (removing elements from the list while iterating over it is
error-prone on its own).

Closes-Bug: #1483287

Change-Id: Id0b8a9b7b11ee2cd249176cab403befdd9e06dbd

mikalstill/nova,cernops/nova,hanlind/nova,felixma/nova,nikesh-mahalka/nova,mahak/nova,gooddata/openstack-nova,MountainWei/nova,zzicewind/nova,Francis-Liu/animated-broccoli,MountainWei/nova,mmnelemane/nova,JianyuWang/nova,bigswitch/nova,noironetworks/nova,cyx1231st/nova,klmitch/nova,noironetworks/nova,isyippee/nova,rahulunair/nova,scripnichenko/nova,barnsnake351/nova,mmnelemane/nova,NeCTAR-RC/nova,rajalokan/nova,takeshineshiro/nova,cernops/nova,hanlind/nova,hanlind/nova,JianyuWang/nova,cloudbase/nova,mikalstill/nova,barnsnake351/nova,zzicewind/nova,sebrandon1/nova,phenoxim/nova,rajalokan/nova,cernops/nova,devendermishrajio/nova,gooddata/openstack-nova,NeCTAR-RC/nova,shail2810/nova,j-carpentier/nova,gooddata/openstack-nova,rahulunair/nova,raildo/nova,Juniper/nova,rajalokan/nova,openstack/nova,jianghuaw/nova,alaski/nova,CCI-MOC/nova,j-carpentier/nova,TwinkleChawla/nova,yosshy/nova,openstack/nova,devendermishrajio/nova,CCI-MOC/nova,cloudbase/nova,jianghuaw/nova,mahak/nova,phenoxim/nova,nikesh-mahalka/nova,gooddata/openstack-nova,fnordahl/nova,Francis-Liu/animated-broccoli,cyx1231st/nova,vmturbo/nova,isyippee/nova,BeyondTheClouds/nova,jianghuaw/nova,Juniper/nova,mahak/nova,rahulunair/nova,whitepages/nova,bigswitch/nova,zhimin711/nova,whitepages/nova,fnordahl/nova,scripnichenko/nova,BeyondTheClouds/nova,BeyondTheClouds/nova,klmitch/nova,alaski/nova,sebrandon1/nova,takeshineshiro/nova,shail2810/nova,edulramirez/nova,sebrandon1/nova,TwinkleChawla/nova,klmitch/nova,CEG-FYP-OpenStack/scheduler,mikalstill/nova,vmturbo/nova,rajalokan/nova,CEG-FYP-OpenStack/scheduler,edulramirez/nova,raildo/nova,ted-gould/nova,watonyweng/nova,felixma/nova,watonyweng/nova,vmturbo/nova,LoHChina/nova,jianghuaw/nova,LoHChina/nova,dims/nova,zhimin711/nova,ted-gould/nova,apporc/nova,vmturbo/nova,klmitch/nova,openstack/nova,dims/nova,Juniper/nova,cloudbase/nova,apporc/nova,yosshy/nova,Juniper/nova