From 66d0c9237c792d286e713921a8d3ec298b15c53b Mon Sep 17 00:00:00 2001 From: FrancescoDeSimone Date: Mon, 11 Jul 2022 17:46:15 +0000 Subject: [PATCH] Skip nrpe check if manila-ganesha-az1 not deployed (#826) --- zaza/openstack/charm_tests/manila_ganesha/tests.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zaza/openstack/charm_tests/manila_ganesha/tests.py b/zaza/openstack/charm_tests/manila_ganesha/tests.py index 7db9569..2b6fda4 100644 --- a/zaza/openstack/charm_tests/manila_ganesha/tests.py +++ b/zaza/openstack/charm_tests/manila_ganesha/tests.py @@ -41,7 +41,7 @@ class ManilaGaneshaTests(manila_tests.ManilaBaseTest): def _restart_share_instance(self): logging.info('Restarting manila-share and nfs-ganesha') - # It would be better for thie to derive the application name, + # It would be better for this to derive the application name, # manila-ganesha-az1, from deployed instances of the manila-ganesha # charm; however, that functionality isn't present yet in zaza, so # this is a best-guestimate arrived at by looking for applications @@ -65,7 +65,12 @@ class ManilaGaneshaTests(manila_tests.ManilaBaseTest): except KeyError: self.skipTest("Skipped NRPE checks since nrpe is not deployed.") - units = zaza.model.get_units("manila-ganesha-az1") + units = [] + try: + units = zaza.model.get_units("manila-ganesha-az1") + except KeyError: + self.skipTest("Skipped NRPE checks since" + "manila-ganesha-az1 is not deployed.") for attempt in tenacity.Retrying( wait=tenacity.wait_fixed(20),