Skip to content

Commit

Permalink
Fix function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
lmlg committed Aug 14, 2024
1 parent fcdcc81 commit fd160e8
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions zaza/openstack/charm_tests/ceph/rbd_mirror/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.get('Stdout'))
return json.loads(result.results['output'])

def get_pools(self):
"""Retrieve list of pools from both sites.
Expand Down Expand Up @@ -495,14 +495,14 @@ def execute_failover_juju_actions(self,
# Run the 'demote' Juju action against the primary site pools.
logging.info('Demoting {} from model {}.'.format(
primary_site_app_name, primary_site_model))
result = zaza.model.run_action_on_leader(
result = zaza.model.run_on_leader(
primary_site_app_name,
'demote',
model_name=primary_site_model,
action_params={
'pools': ','.join(primary_site_pools)
})
logging.info(result.results)
logging.info(result)
self.assertEqual(int(result.get('Code')), 0)

# Validate that the demoted pools count matches the total primary site
Expand All @@ -529,14 +529,14 @@ def execute_failover_juju_actions(self,
# Run the 'promote' Juju against the secondary site.
logging.info('Promoting {} from model {}.'.format(
secondary_site_app_name, secondary_site_model))
result = zaza.model.run_action_on_leader(
result = zaza.model.run_on_leader(
secondary_site_app_name,
'promote',
model_name=secondary_site_model,
action_params={
'pools': ','.join(secondary_site_pools)
})
logging.info(result.results)
logging.info(result)
self.assertEqual(int(result.get('Code')), 0)

# Validate that the promoted pools count matches the total secondary
Expand Down Expand Up @@ -702,15 +702,15 @@ def test_203_juju_resync(self):
site_b_app_name = self.application_name + self.site_b_app_suffix
logging.info('Re-syncing {} from model {}'.format(
site_b_app_name, self.site_b_model))
result = zaza.model.run_action_on_leader(
result = zaza.model.run_on_leader(
site_b_app_name,
'resync-pools',
model_name=self.site_b_model,
action_params={
'pools': ','.join(site_b_pools),
'i-really-mean-it': True,
})
logging.info(result.results)
logging.info(result)
self.assertEqual(int(result.get('Code')), 0)

# Validate that the Ceph images from site-b report 'up+replaying'
Expand Down Expand Up @@ -794,7 +794,7 @@ def test_100_forced_juju_failover(self):
self.kill_primary_site()

# Try and promote the site-b to primary.
result = zaza.model.run_action_on_leader(
result = zaza.model.run_on_leader(
site_b_app_name,
'promote',
model_name=self.site_b_model,
Expand All @@ -816,7 +816,6 @@ def test_100_forced_juju_failover(self):
'force': True,
'pools': ','.join(site_b_pools),
})
self.assertEqual(int(result.get('Code')), 0)

# Validate successful Juju action execution
self.assertEqual(result.status, 'completed')
Expand Down

0 comments on commit fd160e8

Please sign in to comment.