Change open(file) to with block
Change open(file) to with block

Currently script which loads metadata definitions to database
uses open(file) to stream files. This isn't the best practice
because in case of any errors this code may not be safe.
To solve this problem this patch changes open(file) to
'with open(file) as...:' block. It allows us to ensure that every
resource is cleaned up when the code finishes running.

Change-Id: I4a85700061ed5050f4356f1b39ea128931626c83
Closes-Bug: #1367172

openstack/glance,openstack/glance,vuntz/glance,wkoathp/glance,akash1808/glance,takeshineshiro/glance,darren-wang/gl,vuntz/glance,jumpstarter-io/glance,stevelle/glance,wkoathp/glance,sigmavirus24/glance,kfwang/Glance-OVA-OVF,redhat-openstack/glance,rajalokan/glance,darren-wang/gl,paramite/glance,redhat-openstack/glance,klmitch/glance,JioCloud/glance,kfwang/Glance-OVA-OVF,scripnichenko/glance,ozamiatin/glance,stevelle/glance,paramite/glance,saeki-masaki/glance,takeshineshiro/glance,dims/glance,jumpstarter-io/glance,sigmavirus24/glance,klmitch/glance,akash1808/glance,openstack/glance,rajalokan/glance,dims/glance,saeki-masaki/glance,JioCloud/glance,ozamiatin/glance,scripnichenko/glance