Adding service type as configurable shell option
fixes lp#997698 Change-Id: I5179a2ed5f32a8e7253806f6f9b02de3c06913ed
This commit is contained in:
1
AUTHORS
1
AUTHORS
@@ -5,3 +5,4 @@ Dean Troyer <dtroyer@gmail.com>
|
|||||||
Gabriel Hurley <gabriel@strikeawe.com>
|
Gabriel Hurley <gabriel@strikeawe.com>
|
||||||
James E. Blair <jeblair@hp.com>
|
James E. Blair <jeblair@hp.com>
|
||||||
Chuck Short <chuck.short@canonical.com>
|
Chuck Short <chuck.short@canonical.com>
|
||||||
|
Michael Basnight <mbasnight@gmail.com>
|
@@ -85,6 +85,10 @@ class OpenStackImagesShell(object):
|
|||||||
default=utils.env('OS_IMAGE_URL'),
|
default=utils.env('OS_IMAGE_URL'),
|
||||||
help='Defaults to env[OS_IMAGE_URL]')
|
help='Defaults to env[OS_IMAGE_URL]')
|
||||||
|
|
||||||
|
parser.add_argument('--os-service-type',
|
||||||
|
default=utils.env('OS_SERVICE_TYPE'),
|
||||||
|
help='Defaults to env[OS_SERVICE_TYPE]')
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def get_subcommand_parser(self, version):
|
def get_subcommand_parser(self, version):
|
||||||
@@ -150,8 +154,10 @@ class OpenStackImagesShell(object):
|
|||||||
tenant_id=kwargs.get('tenant_id'),
|
tenant_id=kwargs.get('tenant_id'),
|
||||||
tenant_name=kwargs.get('tenant_name'),
|
tenant_name=kwargs.get('tenant_name'),
|
||||||
auth_url=kwargs.get('auth_url'))
|
auth_url=kwargs.get('auth_url'))
|
||||||
endpoint = _ksclient.service_catalog.url_for(service_type='image',
|
service_type = kwargs.get('service_type') or 'image'
|
||||||
endpoint_type='publicURL')
|
endpoint = _ksclient.service_catalog.url_for(
|
||||||
|
service_type=service_type,
|
||||||
|
endpoint_type='publicURL')
|
||||||
endpoint = self._strip_version(endpoint)
|
endpoint = self._strip_version(endpoint)
|
||||||
return (endpoint, _ksclient.auth_token)
|
return (endpoint, _ksclient.auth_token)
|
||||||
|
|
||||||
@@ -210,7 +216,8 @@ class OpenStackImagesShell(object):
|
|||||||
'password': args.os_password,
|
'password': args.os_password,
|
||||||
'tenant_id': args.os_tenant_id,
|
'tenant_id': args.os_tenant_id,
|
||||||
'tenant_name': args.os_tenant_name,
|
'tenant_name': args.os_tenant_name,
|
||||||
'auth_url': args.os_auth_url
|
'auth_url': args.os_auth_url,
|
||||||
|
'service_type': args.os_service_type
|
||||||
}
|
}
|
||||||
endpoint, token = self._authenticate(**kwargs)
|
endpoint, token = self._authenticate(**kwargs)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user