From 828883bb70b3d786cece6a467f93b2b03d52cc30 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Thu, 3 Sep 2020 10:06:18 +0100 Subject: [PATCH] Make test_check_pool_types handle missing apps (#405) Currently test_check_pool_types will fail when it tries to check the corresponding pool type for an application that is not present in the deployment, this patch changes the behaviour to skip missing applications. --- zaza/openstack/charm_tests/ceph/tests.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index 45b4920..001fc0f 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -818,8 +818,15 @@ class CheckPoolTypes(unittest.TestCase): ('cinder-ceph', 'cinder-ceph')] runtime_pool_details = zaza_ceph.get_ceph_pool_details() for app, pool_name in app_pools: - juju_pool_config = zaza_model.get_application_config(app).get( - 'pool-type') + try: + app_config = zaza_model.get_application_config(app) + except KeyError: + logging.info( + 'Skipping pool check of %s, application %s not present', + pool_name, + app) + continue + juju_pool_config = app_config.get('pool-type') if juju_pool_config: expected_pool_type = juju_pool_config['value'] else: