Support keystone v2 and v3

Though senlin uses keystone v3 on the server side, on the
client side should support both keystone v2 and v3.

Change-Id: I12711b87a2ab114f42abd1c1b4e7fd1724311e4c
This commit is contained in:
Haiwei Xu 2015-07-03 09:15:25 +09:00
parent 608589c916
commit ac7c4b3a06

View File

@ -164,6 +164,7 @@ class SenlinShell(object):
'user ID for authentication')
print(_('WARNING: %s') % msg)
if 'v3' in args.auth_url:
if (args.username and not args.user_id):
if not (args.user_domain_id or args.user_domain_name):
msg = _('Either user domain ID (--user-domain-id / '
@ -201,14 +202,15 @@ class SenlinShell(object):
print(_('WARNING: %s') % msg)
# project name may not be unique
if 'v3' in args.auth_url:
if (not (args.project_id or args.tenant_id) and
(args.project_name or args.tenant_name) and
not (args.project_domain_id or args.project_domain_name)):
msg = _('Either project domain ID (--project-domain-id / '
'env[OS_PROJECT_DOMAIN_ID]) orr project domain name '
'(--project-domain-name / env[OS_PROJECT_DOMAIN_NAME '
'must be specified, because project/tenant name may not '
'be unique.')
'must be specified, because project/tenant name may '
'not be unique.')
raise exc.CommandError(msg)
def _setup_senlin_client(self, api_ver, args):