summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Ames <david.ames@canonical.com>2017-10-05 15:30:39 -0700
committerDavid Ames <david.ames@canonical.com>2017-10-13 13:19:27 -0700
commit23b7635be7be5bc92f5f19dcf0c22f390663b400 (patch)
treec8ea07d892d25a10715c0945e60841fbcc333ad1
parentb07920df4a8da51d963106621d6ce3888ab530d7 (diff)
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
Notes
Notes (review): Verified+1: Canonical CI <uosci-testing-bot@ubuntu.com> Code-Review+2: Corey Bryant <corey.bryant@canonical.com> Workflow+1: Corey Bryant <corey.bryant@canonical.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 13 Oct 2017 20:27:00 +0000 Reviewed-on: https://review.openstack.org/509927 Project: openstack/charm-interface-keystone-admin Branch: refs/heads/master
-rw-r--r--.gitignore1
-rw-r--r--.gitreview4
-rw-r--r--requires.py23
-rw-r--r--tox.ini7
4 files changed, 30 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..172bf57
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
.tox
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..8730ad3
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,4 @@
1[gerrit]
2host=review.openstack.org
3port=29418
4project=openstack/charm-interface-keystone-admin
diff --git a/requires.py b/requires.py
index e66a115..879f4f2 100644
--- a/requires.py
+++ b/requires.py
@@ -45,18 +45,37 @@ class KeystoneRequires(RelationBase):
45 u'service_username': u'admin', 45 u'service_username': u'admin',
46 u'service_tenant_name': u'Admin', 46 u'service_tenant_name': u'Admin',
47 u'service_region': u'RegionOne'} 47 u'service_region': u'RegionOne'}
48 keystone v3 also provides
49 {api_version: "3"
50 service_project_domain_name: admin_domain
51 service_project_name: admin
52 service_protocol: http
53 service_region: RegionOne
54 service_user_domain_name: admin_domain}
48 """ 55 """
49 convs = self.conversations() 56 convs = self.conversations()
50 if len(convs) > 0: 57 if len(convs) > 0:
51 conv = convs[0] 58 conv = convs[0]
52 return { 59 id_admin_data = {
53 'service_hostname': conv.get_remote('service_hostname'), 60 'service_hostname': conv.get_remote('service_hostname'),
54 'service_port': conv.get_remote('service_port'), 61 'service_port': conv.get_remote('service_port'),
55 'service_username': conv.get_remote('service_username'), 62 'service_username': conv.get_remote('service_username'),
56 'service_password': conv.get_remote('service_password'), 63 'service_password': conv.get_remote('service_password'),
57 'service_tenant_name': conv.get_remote('service_tenant_name'), 64 'service_tenant_name': conv.get_remote('service_tenant_name'),
58 'service_region': conv.get_remote('service_region') 65 'service_region': conv.get_remote('service_region'),
59 } 66 }
67 if conv.get_remote('api_version', u'2') > u'2':
68 id_admin_data['api_version'] = (
69 conv.get_remote('api_version', u'2'))
70 id_admin_data['service_user_domain_name'] = (
71 conv.get_remote('service_user_domain_name'))
72 id_admin_data['service_project_domain_name'] = (
73 conv.get_remote('service_project_domain_name'))
74 id_admin_data['service_project_name'] = (
75 conv.get_remote('service_project_name'))
76 id_admin_data['service_protocol'] = (
77 conv.get_remote('service_protocol'))
78 return id_admin_data
60 else: 79 else:
61 return {} 80 return {}
62 81
diff --git a/tox.ini b/tox.ini
index c035f1a..7472793 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
1[tox] 1[tox]
2envlist = lint,py27 2envlist = pep8,py27
3skipsdist = True 3skipsdist = True
4 4
5[testenv] 5[testenv]
@@ -7,13 +7,14 @@ setenv = VIRTUAL_ENV={envdir}
7 PYTHONHASHSEED=0 7 PYTHONHASHSEED=0
8install_command = 8install_command =
9 pip install --allow-unverified python-apt {opts} {packages} 9 pip install --allow-unverified python-apt {opts} {packages}
10commands = ostestr {posargs} 10whitelist_externals = true
11commands = true
11 12
12[testenv:py27] 13[testenv:py27]
13basepython = python2.7 14basepython = python2.7
14deps = -r{toxinidir}/test-requirements.txt 15deps = -r{toxinidir}/test-requirements.txt
15 16
16[testenv:lint] 17[testenv:pep8]
17basepython = python2.7 18basepython = python2.7
18deps = -r{toxinidir}/test-requirements.txt 19deps = -r{toxinidir}/test-requirements.txt
19commands = flake8 {posargs} 20commands = flake8 {posargs}