Fix black issues
[osm/N2VC.git] / n2vc / n2vc_juju_conn.py
index 9ed225d..943d70d 100644 (file)
@@ -814,8 +814,9 @@ class N2VCJujuConnector(N2VCConnector):
         will_not_delete = False
         if namespace not in self.delete_namespace_locks:
             self.delete_namespace_locks[namespace] = asyncio.Lock(loop=self.loop)
+        delete_lock = self.delete_namespace_locks[namespace]
 
-        while self.delete_namespace_locks[namespace].locked():
+        while delete_lock.locked():
             will_not_delete = True
             await asyncio.sleep(0.1)
 
@@ -824,7 +825,7 @@ class N2VCJujuConnector(N2VCConnector):
             return
 
         try:
-            async with self.delete_namespace_locks[namespace]:
+            async with delete_lock:
                 libjuju = await self._get_libjuju(vca_id)
 
                 # check arguments
@@ -1135,7 +1136,6 @@ class N2VCJujuConnector(N2VCConnector):
             )
 
     def _write_ee_id_db(self, db_dict: dict, ee_id: str):
-
         # write ee_id to database: _admin.deployed.VCA.x
         try:
             the_table = db_dict["collection"]