Hook up region_name argument
Connect the --os-region-name option passed through the CLI to the call to service_catalog.url_for. Fixes bug 1080739. Change-Id: I2d19d62a999a82a91de3883db12bbc24e900de25
This commit is contained in:
parent
046d34c891
commit
3003ed8ef8
@ -311,9 +311,16 @@ class OpenStackImagesShell(object):
|
|||||||
|
|
||||||
def _get_endpoint(self, client, **kwargs):
|
def _get_endpoint(self, client, **kwargs):
|
||||||
"""Get an endpoint using the provided keystone client."""
|
"""Get an endpoint using the provided keystone client."""
|
||||||
endpoint = client.service_catalog.url_for(
|
endpoint_kwargs = {
|
||||||
service_type=kwargs.get('service_type') or 'image',
|
'service_type': kwargs.get('service_type') or 'image',
|
||||||
endpoint_type=kwargs.get('endpoint_type') or 'publicURL')
|
'endpoint_type': kwargs.get('endpoint_type') or 'publicURL',
|
||||||
|
}
|
||||||
|
|
||||||
|
if kwargs.get('region_name'):
|
||||||
|
endpoint_kwargs['attr'] = 'region'
|
||||||
|
endpoint_kwargs['filter_value'] = kwargs.get('region_name')
|
||||||
|
|
||||||
|
endpoint = client.service_catalog.url_for(**endpoint_kwargs)
|
||||||
return self._strip_version(endpoint)
|
return self._strip_version(endpoint)
|
||||||
|
|
||||||
def _get_image_url(self, args):
|
def _get_image_url(self, args):
|
||||||
@ -389,7 +396,8 @@ class OpenStackImagesShell(object):
|
|||||||
'auth_url': args.os_auth_url,
|
'auth_url': args.os_auth_url,
|
||||||
'service_type': args.os_service_type,
|
'service_type': args.os_service_type,
|
||||||
'endpoint_type': args.os_endpoint_type,
|
'endpoint_type': args.os_endpoint_type,
|
||||||
'insecure': args.insecure
|
'insecure': args.insecure,
|
||||||
|
'region_name': args.os_region_name,
|
||||||
}
|
}
|
||||||
_ksclient = self._get_ksclient(**kwargs)
|
_ksclient = self._get_ksclient(**kwargs)
|
||||||
token = args.os_auth_token or _ksclient.auth_token
|
token = args.os_auth_token or _ksclient.auth_token
|
||||||
|
Loading…
x
Reference in New Issue
Block a user