From a7b63b79d40236659c408c468cfb10b96e829ed4 Mon Sep 17 00:00:00 2001 From: James Page Date: Sun, 9 Sep 2018 08:20:18 +0100 Subject: [PATCH] py3: Switch to using Python 3 for rocky or later Switch package install to Python 3 for OpenStack Rocky or later. Depends-On: I17a93524fb7ec134b4a3a61cd0e86977daf49c4e Change-Id: Ia63ee8ced1299eccd84d4d07d5272234e8737e17 --- src/lib/charm/openstack/aodh.py | 24 ++++++++++++++++++++++++ src/tox.ini | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/lib/charm/openstack/aodh.py b/src/lib/charm/openstack/aodh.py index f8ebe81..0428874 100644 --- a/src/lib/charm/openstack/aodh.py +++ b/src/lib/charm/openstack/aodh.py @@ -150,6 +150,30 @@ class AodhCharmOcata(AodhCharm): # no need to restart aodh-api in ocata and onwards +class AodhCharmRocky(AodhCharmOcata): + + release = 'rocky' + + # Switch to Python 3 for Rocky onwards + packages = [ + 'aodh-api', + 'aodh-evaluator', + 'aodh-expirer', + 'aodh-notifier', + 'aodh-listener', + 'python3-aodh', + 'libapache2-mod-wsgi-py3', + 'python-apt', # NOTE: workaround for hacluster suboridinate + ] + + purge_packages = [ + 'python-aodh', + 'python-memcache', + ] + + python_version = 3 + + def install(): """Use the singleton from the AodhCharm to install the packages on the unit diff --git a/src/tox.ini b/src/tox.ini index 0ec9b18..b6f486d 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!)