diff --git a/zaza/openstack/charm_tests/ceph/rbd_mirror/tests.py b/zaza/openstack/charm_tests/ceph/rbd_mirror/tests.py index fc7be505f..e2426ae81 100644 --- a/zaza/openstack/charm_tests/ceph/rbd_mirror/tests.py +++ b/zaza/openstack/charm_tests/ceph/rbd_mirror/tests.py @@ -216,7 +216,7 @@ def run_status_action(self, application_name=None, model_name=None, if result.status == "failed": logging.error("status action failed: %s", result.message) return - return json.loads(result.results['output']) + return json.loads(result.get('Stdout')) def get_pools(self): """Retrieve list of pools from both sites. @@ -503,11 +503,11 @@ def execute_failover_juju_actions(self, 'pools': ','.join(primary_site_pools) }) logging.info(result.results) - self.assertEqual(int(result.results['Code']), 0) + self.assertEqual(int(result.get('Code')), 0) # Validate that the demoted pools count matches the total primary site # pools count. - n_pools_demoted = len(result.results['output'].split('\n')) + n_pools_demoted = len(result.get('Stdout').split('\n')) self.assertEqual(len(primary_site_pools), n_pools_demoted) # At this point, both primary and secondary sites are demoted. Validate @@ -537,11 +537,11 @@ def execute_failover_juju_actions(self, 'pools': ','.join(secondary_site_pools) }) logging.info(result.results) - self.assertEqual(int(result.results['Code']), 0) + self.assertEqual(int(result.get('Code')), 0) # Validate that the promoted pools count matches the total secondary # site pools count. - n_pools_promoted = len(result.results['output'].split('\n')) + n_pools_promoted = len(result.get('Stdout').split('\n')) self.assertEqual(len(secondary_site_pools), n_pools_promoted) # Validate that the Ceph images from the newly promoted site @@ -711,7 +711,7 @@ def test_203_juju_resync(self): 'i-really-mean-it': True, }) logging.info(result.results) - self.assertEqual(int(result.results['Code']), 0) + self.assertEqual(int(result.get('Code')), 0) # Validate that the Ceph images from site-b report 'up+replaying' # (which is reported by secondary Ceph images). And check that images @@ -801,7 +801,7 @@ def test_100_forced_juju_failover(self): action_params={ 'pools': ','.join(site_b_pools), }) - self.assertEqual(int(result.results['Code']), 0) + self.assertEqual(int(result.get('Code')), 0) # The action may not show up as 'failed' if there are no pools that # needed to be promoted. @@ -816,7 +816,7 @@ def test_100_forced_juju_failover(self): 'force': True, 'pools': ','.join(site_b_pools), }) - self.assertEqual(int(result.results['Code']), 0) + self.assertEqual(int(result.get('Code')), 0) # Validate successful Juju action execution self.assertEqual(result.status, 'completed')