Keystone v3 needs extra parameters

To support keystone v3, this commit adds project_domain_name and
user_domain_name into env.

Change-Id: Ic1b7e9d6bbb62f2c9aaa468c4c64d07ae34cdd20
This commit is contained in:
houweichao 2016-12-12 17:00:53 +08:00 committed by Jeremy Liu
parent b423e2071e
commit a9e2a83e26
2 changed files with 26 additions and 2 deletions

View File

@ -62,6 +62,8 @@ class KeystoneAuthHandler(auth.AuthHandler):
target_cacert = req.get('target_cacert')
target_region_name = req.get('target_region_name')
target_insecure = req.get('target_insecure')
user_domain_name = req.get('user_domain_name', 'Default')
project_domain_name = req.get('project_domain_name', 'Default')
if project_name and project_id:
raise RuntimeError(
@ -88,7 +90,9 @@ class KeystoneAuthHandler(auth.AuthHandler):
auth_url=auth_url,
endpoint=auth_url,
cacert=cacert,
insecure=insecure
insecure=insecure,
user_domain_name=user_domain_name,
project_domain_name=project_domain_name
)
keystone.authenticate()

View File

@ -283,6 +283,24 @@ class MistralShell(app.App):
help='Authentication token (Env: OS_AUTH_TOKEN)'
)
parser.add_argument(
'--os-project-domain-name',
action='store',
dest='project_domain_name',
default=env('OS_PROJECT_DOMAIN_NAME', default='Default'),
help='Authentication project domain name'
' (Env: OS_PROJECT_DOMAIN_NAME)'
)
parser.add_argument(
'--os-user-domain-name',
action='store',
dest='user_domain_name',
default=env('OS_USER_DOMAIN_NAME', default='Default'),
help='Authentication user domain name'
' (Env: OS_USER_DOMAIN_NAME)'
)
parser.add_argument(
'--os-auth-url',
action='store',
@ -490,7 +508,9 @@ class MistralShell(app.App):
kwargs = {
'cert': self.options.os_cert,
'key': self.options.os_key
'key': self.options.os_key,
'user_domain_name': self.options.user_domain_name,
'project_domain_name': self.options.project_domain_name
}
self.client = client.client(