Skip to content

Commit 02628a1

Browse files
committed
Check arg to be a List[str] instead of any iterable for wait_for_idle
1 parent 879232c commit 02628a1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

juju/model.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,6 +2581,12 @@ async def wait_for_idle(self, apps=None, raise_on_error=True, raise_on_blocked=F
25812581
timeout = timedelta(seconds=timeout) if timeout is not None else None
25822582
idle_period = timedelta(seconds=idle_period)
25832583
start_time = datetime.now()
2584+
# Type check against the common error of passing a str for apps
2585+
if apps is not None and (not isinstance(apps, list) or
2586+
any(not isinstance(o, str)
2587+
for o in apps)):
2588+
raise JujuError(f'Expected a List[str] for apps, given {apps}')
2589+
25842590
apps = apps or self.applications
25852591
idle_times = {}
25862592
last_log_time = None

0 commit comments

Comments
 (0)