X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=n2vc%2Flibjuju.py;h=e73e552a046f0a62e18318c1227579df3f285538;hp=c62b11cd368dcb5724ab586c21320d95159e0b76;hb=c38a696d168531e3c067451044262ef4d78ef11f;hpb=ba6e532cda6464759381585452b18f9fd1a19dd3 diff --git a/n2vc/libjuju.py b/n2vc/libjuju.py index c62b11c..e73e552 100644 --- a/n2vc/libjuju.py +++ b/n2vc/libjuju.py @@ -242,7 +242,9 @@ class Libjuju: """ if not model_names: raise Exception( - "model_names must be a non-empty array. Given value: {}".format(model_names) + "model_names must be a non-empty array. Given value: {}".format( + model_names + ) ) non_existing_models = [] models = await self.list_models() @@ -624,7 +626,9 @@ class Libjuju: if await u.is_leader_from_status(): unit = u if unit is None: - raise JujuLeaderUnitNotFound("Cannot execute action: leader unit not found") + raise JujuLeaderUnitNotFound( + "Cannot execute action: leader unit not found" + ) actions = await application.get_actions() @@ -703,10 +707,7 @@ class Libjuju: await self.disconnect_controller(controller) async def add_relation( - self, - model_name: str, - endpoint_1: str, - endpoint_2: str, + self, model_name: str, endpoint_1: str, endpoint_2: str, ): """Add relation @@ -863,9 +864,7 @@ class Libjuju: # wait for machine removal machines = await model.get_machines() while machine_id in machines and time.time() < end: - self.log.debug( - "Waiting for machine {} is destroyed".format(machine_id) - ) + self.log.debug("Waiting for machine {} is destroyed".format(machine_id)) await asyncio.sleep(0.5) machines = await model.get_machines() self.log.debug("Machine destroyed: {}".format(machine_id))