Enable Keystone v3
The interface was not collecting all keystone v3 information passed along the relation. This change adds the keystone v3 authentication settings. Avoid stestr failures due to lack of unit tests. Change-Id: If7dfd6ec0c6b4e88497c372a37c9be9844845e70
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.tox
|
4
.gitreview
Normal file
4
.gitreview
Normal file
@@ -0,0 +1,4 @@
|
||||
[gerrit]
|
||||
host=review.openstack.org
|
||||
port=29418
|
||||
project=openstack/charm-interface-keystone-admin
|
23
requires.py
23
requires.py
@@ -45,18 +45,37 @@ class KeystoneRequires(RelationBase):
|
||||
u'service_username': u'admin',
|
||||
u'service_tenant_name': u'Admin',
|
||||
u'service_region': u'RegionOne'}
|
||||
keystone v3 also provides
|
||||
{api_version: "3"
|
||||
service_project_domain_name: admin_domain
|
||||
service_project_name: admin
|
||||
service_protocol: http
|
||||
service_region: RegionOne
|
||||
service_user_domain_name: admin_domain}
|
||||
"""
|
||||
convs = self.conversations()
|
||||
if len(convs) > 0:
|
||||
conv = convs[0]
|
||||
return {
|
||||
id_admin_data = {
|
||||
'service_hostname': conv.get_remote('service_hostname'),
|
||||
'service_port': conv.get_remote('service_port'),
|
||||
'service_username': conv.get_remote('service_username'),
|
||||
'service_password': conv.get_remote('service_password'),
|
||||
'service_tenant_name': conv.get_remote('service_tenant_name'),
|
||||
'service_region': conv.get_remote('service_region')
|
||||
'service_region': conv.get_remote('service_region'),
|
||||
}
|
||||
if conv.get_remote('api_version', u'2') > u'2':
|
||||
id_admin_data['api_version'] = (
|
||||
conv.get_remote('api_version', u'2'))
|
||||
id_admin_data['service_user_domain_name'] = (
|
||||
conv.get_remote('service_user_domain_name'))
|
||||
id_admin_data['service_project_domain_name'] = (
|
||||
conv.get_remote('service_project_domain_name'))
|
||||
id_admin_data['service_project_name'] = (
|
||||
conv.get_remote('service_project_name'))
|
||||
id_admin_data['service_protocol'] = (
|
||||
conv.get_remote('service_protocol'))
|
||||
return id_admin_data
|
||||
else:
|
||||
return {}
|
||||
|
||||
|
7
tox.ini
7
tox.ini
@@ -1,5 +1,5 @@
|
||||
[tox]
|
||||
envlist = lint,py27
|
||||
envlist = pep8,py27
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
@@ -7,13 +7,14 @@ setenv = VIRTUAL_ENV={envdir}
|
||||
PYTHONHASHSEED=0
|
||||
install_command =
|
||||
pip install --allow-unverified python-apt {opts} {packages}
|
||||
commands = ostestr {posargs}
|
||||
whitelist_externals = true
|
||||
commands = true
|
||||
|
||||
[testenv:py27]
|
||||
basepython = python2.7
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
|
||||
[testenv:lint]
|
||||
[testenv:pep8]
|
||||
basepython = python2.7
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
commands = flake8 {posargs}
|
||||
|
Reference in New Issue
Block a user