From 4163fdcbeefbe197204ae06177e81d776baa548e Mon Sep 17 00:00:00 2001 From: David Ames Date: Fri, 30 Nov 2018 11:28:05 -0800 Subject: [PATCH] Enable Rocky and python3 When the primary keystone is deployed with rocky and python3 the charm fails to install the correct python3 packages and use the correct clients. Note: A related bug #1798184, will cause the tests to fail. A complete Rocky python3 solution is dependent on #1798184 being resolved. Change-Id: I42d8a5bfff3200d18e7bad0bd29edf12aa6a05c7 Closes-Bug: #1806111 --- src/lib/charm/openstack/keystone_ldap.py | 15 +++++++++++++++ src/tox.ini | 2 +- unit_tests/test_keystone_ldap_handlers.py | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/lib/charm/openstack/keystone_ldap.py b/src/lib/charm/openstack/keystone_ldap.py index 239e038..55400f8 100644 --- a/src/lib/charm/openstack/keystone_ldap.py +++ b/src/lib/charm/openstack/keystone_ldap.py @@ -175,3 +175,18 @@ class KeystoneLDAPCharm(charms_openstack.charm.OpenStackCharm): if (hookenv.config('tls-ca-ldap') and os.path.exists(self.options.backend_ca_file)): os.unlink(self.options.backend_ca_file) + + +class KeystoneLDAPCharmRocky(KeystoneLDAPCharm): + + # First release supported + release = 'rocky' + + # List of packages to install for this charm + # Explicitly install python3-ldap so python3-ldappool does not install + # python-ldap + packages = ['python3-ldap', 'python3-ldappool'] + + purge_packages = ['python-ldap', 'python-ldappool'] + + python_version = 3 diff --git a/src/tox.ini b/src/tox.ini index 0e36e84..fc31006 100644 --- a/src/tox.ini +++ b/src/tox.ini @@ -35,7 +35,7 @@ commands = # Run a specific test as an Amulet smoke test (expected to always pass) basepython = python2.7 commands = - bundletester -vl DEBUG -r json -o func-results.json gate-basic-bionic-queens --no-destroy + bundletester -vl DEBUG -r json -o func-results.json gate-basic-bionic-rocky --no-destroy [testenv:func27-dfs] # Run all deploy-from-source tests which are +x (may not always pass!) diff --git a/unit_tests/test_keystone_ldap_handlers.py b/unit_tests/test_keystone_ldap_handlers.py index b3018ce..e9cbb89 100644 --- a/unit_tests/test_keystone_ldap_handlers.py +++ b/unit_tests/test_keystone_ldap_handlers.py @@ -15,7 +15,7 @@ from __future__ import print_function import mock from charms_openstack.test_mocks import charmhelpers as ch -ch.contrib.openstack.utils.OPENSTACK_RELEASES = ('mitaka', ) +ch.contrib.openstack.utils.OPENSTACK_RELEASES = ('mitaka', 'rocky') import reactive.keystone_ldap_handlers as handlers