Skip to content

Commit 8286418

Browse files
committed
Use application.get_status in wait_for_idle to use most up to date
application status
1 parent e4b8a80 commit 8286418

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

juju/model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def __init__(self, entity_id, model, history_index=-1, connected=True):
264264
self._history_index = history_index
265265
self.connected = connected
266266
self.connection = model.connection()
267+
self._status = 'unknown'
267268

268269
def __repr__(self):
269270
return '<{} entity_id="{}">'.format(type(self).__name__,
@@ -2516,9 +2517,10 @@ def _raise_for_status(entities, status):
25162517
busy.append(app_name + " (missing)")
25172518
continue
25182519
app = self.applications[app_name]
2519-
if raise_on_error and app.status == "error":
2520+
app_status = await app.get_status()
2521+
if raise_on_error and app_status == "error":
25202522
errors.setdefault("App", []).append(app.name)
2521-
if raise_on_blocked and app.status == "blocked":
2523+
if raise_on_blocked and app_status == "blocked":
25222524
blocks.setdefault("App", []).append(app.name)
25232525
# Check if wait_for_exact_units flag is used
25242526
if wait_for_exact_units > 0:

0 commit comments

Comments
 (0)