@@ -2229,7 +2229,7 @@ async def _get_source_api(self, url, controller_name=None):
22292229
22302230 async def wait_for_idle (self , apps = None , raise_on_error = True , raise_on_blocked = False ,
22312231 wait_for_active = False , timeout = 10 * 60 , idle_period = 15 , check_freq = 0.5 ,
2232- wait_for_status = None ):
2232+ status = None ):
22332233 """Wait for applications in the model to settle into an idle state.
22342234
22352235 :param apps (list[str]): Optional list of specific app names to wait on.
@@ -2262,12 +2262,12 @@ async def wait_for_idle(self, apps=None, raise_on_error=True, raise_on_blocked=F
22622262 :param check_freq (float): How frequently, in seconds, to check the model.
22632263 The default is every half-second.
22642264
2265- :param wait_for_status (str): The status to wait for. If None, not waiting.
2265+ :param status (str): The status to wait for. If None, not waiting.
22662266 The default is None (not waiting for any status).
22672267 """
22682268 if wait_for_active :
2269- warnings .warn ("wait_for_active is deprecated; use wait_for_status " , DeprecationWarning )
2270- wait_for_status = "active"
2269+ warnings .warn ("wait_for_active is deprecated; use status " , DeprecationWarning )
2270+ status = "active"
22712271
22722272 timeout = timedelta (seconds = timeout ) if timeout is not None else None
22732273 idle_period = timedelta (seconds = idle_period )
@@ -2320,7 +2320,7 @@ def _raise_for_status(entities, status):
23202320 if raise_on_blocked and unit .workload_status == "blocked" :
23212321 blocks .setdefault ("Unit" , []).append (unit .name )
23222322 continue
2323- waiting_for_status = wait_for_status and unit .workload_status != wait_for_status
2323+ waiting_for_status = status and unit .workload_status != status
23242324 if not waiting_for_status and unit .agent_status == "idle" :
23252325 now = datetime .now ()
23262326 idle_start = idle_times .setdefault (unit .name , now )
0 commit comments