X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=n2vc%2Fjuju_watcher.py;h=e206e060da1b6d3496d4f56415810c6c4cd150c4;hp=04ad10fe200bd317c85160c062df4ec02805e721;hb=refs%2Fchanges%2F16%2F10616%2F9;hpb=6331b04745fcd6d44b1b0320ca6e3e63cdebd0e8 diff --git a/n2vc/juju_watcher.py b/n2vc/juju_watcher.py index 04ad10f..e206e06 100644 --- a/n2vc/juju_watcher.py +++ b/n2vc/juju_watcher.py @@ -72,7 +72,10 @@ def application_ready(application: Application) -> bool: class JujuModelWatcher: @staticmethod - async def wait_for_model(model: Model, timeout: float = 3600): + async def wait_for_model( + model: Model, + timeout: float = 3600 + ): """ Wait for all entities in model to reach its final state. @@ -121,6 +124,7 @@ class JujuModelWatcher: total_timeout: float = 3600, db_dict: dict = None, n2vc: N2VCConnector = None, + vca_id: str = None, ): """ Wait for entity to reach its final state. @@ -131,6 +135,7 @@ class JujuModelWatcher: :param: total_timeout: Timeout for the entity to be active :param: db_dict: Dictionary with data of the DB to write the updates :param: n2vc: N2VC Connector objector + :param: vca_id: VCA ID :raises: asyncio.TimeoutError when timeout reaches """ @@ -161,6 +166,7 @@ class JujuModelWatcher: timeout=progress_timeout, db_dict=db_dict, n2vc=n2vc, + vca_id=vca_id, ) ) @@ -182,6 +188,7 @@ class JujuModelWatcher: timeout: float, db_dict: dict = None, n2vc: N2VCConnector = None, + vca_id: str = None, ): """ Observes the changes related to an specific entity in a model @@ -192,6 +199,7 @@ class JujuModelWatcher: :param: timeout: Maximum time between two updates in the model :param: db_dict: Dictionary with data of the DB to write the updates :param: n2vc: N2VC Connector objector + :param: vca_id: VCA ID :raises: asyncio.TimeoutError when timeout reaches """ @@ -249,6 +257,7 @@ class JujuModelWatcher: detailed_status=status_message, vca_status=vca_status, entity_type=delta_entity, + vca_id=vca_id, ) # Check if timeout if time.time() > timeout_end: