From 48c65577a60444fb8ddd10b6bf11ecc148af2add Mon Sep 17 00:00:00 2001 From: James Page Date: Tue, 18 Sep 2018 15:23:09 +0200 Subject: [PATCH] py3: Switch manila to run under Python 3 at Rocky Switch charm to run manila under Python 3 for Rocky or later: - Force use of python3-manila - Purge python-* packages previously installed on upgrade - Tag charm class as python 3 Change-Id: I750a63a4d913cd847d2fb24e7396764079f18524 --- src/lib/charm/openstack/manila.py | 21 +++++++++++++++++++++ src/tox.ini | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/lib/charm/openstack/manila.py b/src/lib/charm/openstack/manila.py index f63ca15..f20c667 100644 --- a/src/lib/charm/openstack/manila.py +++ b/src/lib/charm/openstack/manila.py @@ -430,3 +430,24 @@ class ManilaCharm(charms_openstack.charm.HAOpenStackCharm): for config_file, chunks in data.items(): config_files.add(config_file) return list(config_files) + + +class ManilaCharmRocky(ManilaCharm): + + release = 'rocky' + + packages = [ + 'manila-api', + 'manila-data', + 'manila-scheduler', + 'manila-share', + 'python3-manila', + ] + + purge_packages = [ + 'python-manila', + 'python-memcache', + 'python-pymysql', + ] + + python_version = 3 diff --git a/src/tox.ini b/src/tox.ini index 628b390..7c9f838 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!)