Determine region-specific endpoints correctly.

Previous behavior was hardcoded to pick the first endpoint
    `endpoint = item['endpoints'][0]`
and then check if the region matched the configured region.

This fails for regions other than the first listed.

I've modified it to instead search through provided endpoints for a
matching region.  If no region is configured, it falls back to original
behavior of picking first available endpoint.

For reference:
{'access': {'metadata': {'is_admin': 0, 'roles': []},
            'serviceCatalog': [{'endpoints': [{'adminURL': 'someurl',
                                               'id': 'someuuid',
                                               'internalURL': 'someurl',
                                               'publicURL': 'someurl',
                                               'region': 'RegionOne'},
                                              {'adminURL': 'someotherurl',
                                               'id': 'someotheruuid',
                                               'internalURL': 'someotherurl',
                                               'publicURL': 'someotherurl',
                                               'region': 'RegionTwo'}],
                                'endpoints_links': [],
                                'name': 'cinderv2',
                                'type': 'volumev2'},

Change-Id: I13eb1dff9fc3bfdefcdcdc50387b68189b0bba8a
1 file changed