Skip to content

Commit

Permalink
Fix _verify_nova_compute (#397)
Browse files Browse the repository at this point in the history
- logic was getting the app as a string instead of the object
- fix unit tests

Closes: #393
  • Loading branch information
gabrielcocenza authored May 2, 2024
1 parent 1d25afc commit e6f02b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cou/apps/auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ async def _verify_nova_compute(self, target: OpenStackRelease) -> None:
units_not_upgraded = []
apps = await self.model.get_applications()

for app in apps:
for app in apps.values():
if app.charm != "nova-compute":
logger.debug("skipping application %s", app.name)
continue
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/apps/test_auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ async def test_ceph_osd_verify_nova_compute_no_app(model):
},
workload_version="15.2.0",
)
model.get_applications.return_value = [app]
model.get_applications.return_value = {"ceph-osd": app}

await app._verify_nova_compute(target)

Expand Down Expand Up @@ -1288,7 +1288,7 @@ async def test_ceph_osd_verify_nova_compute_pass(mock_lookup, model):
},
workload_version="17.0.1",
)
model.get_applications.return_value = [app, nova_compute]
model.get_applications.return_value = {"ceph-osd": app, "nova-compute": nova_compute}

await app._verify_nova_compute(target)

Expand Down Expand Up @@ -1327,7 +1327,7 @@ async def test_ceph_osd_verify_nova_compute_fail(mock_lookup, model):
},
workload_version="17.0.1",
)
model.get_applications.return_value = [app, nova_compute]
model.get_applications.return_value = {"ceph-osd": app, "nova-compute": nova_compute}

with pytest.raises(ApplicationError, match=f"Units 'nova-compute/0' did not reach {target}."):
await app._verify_nova_compute(target)
Expand Down

0 comments on commit e6f02b6

Please sign in to comment.