Skip to content

Commit

Permalink
Ignore waiting for machine to create Applications class
Browse files Browse the repository at this point in the history
- if the model has an app waiting machine, the machine doesn't
  exist yet and COU fails with AttributeError
  • Loading branch information
gabrielcocenza committed Apr 11, 2024
1 parent fe2d671 commit f1a63ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cou/utils/juju_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ async def _get_machines(self) -> dict[str, Machine]:
apps=tuple(
unit.application
for unit in self._model.units.values()
if unit.machine.id == machine.id
if hasattr(unit.machine, "id") and unit.machine.id == machine.id
),
az=machine.hardware_characteristics.get("availability-zone"),
)
Expand Down Expand Up @@ -370,6 +370,7 @@ async def get_applications(self) -> dict[str, Application]:
workload_version=status.workload_version,
)
for app, status in full_status.applications.items()
if status.status.info != "waiting for machine"
}

@retry(no_retry_exceptions=(ApplicationNotFound,))
Expand Down

0 comments on commit f1a63ea

Please sign in to comment.