Update to Python 3.10 and Ubuntu 22.04
[osm/MON.git] / osm_mon / collector / vnf_collectors / juju.py
index cb924a6..fbc6bc2 100644 (file)
@@ -39,7 +39,6 @@ class VCACollector(BaseCollector):
     def __init__(self, config: Config):
         super().__init__(config)
         self.common_db = CommonDbClient(config)
-        self.loop = asyncio.get_event_loop()
         # host = config.get("vca", "host")
         # port = config.get("vca", "port") if "port" in config.conf["vca"] else 17070
 
@@ -60,7 +59,6 @@ class VCACollector(BaseCollector):
             db=self.common_db.common_db,
             fs=object(),
             log=log,
-            loop=self.loop,
             on_update_db=None,
         )
 
@@ -110,7 +108,7 @@ class VCACollector(BaseCollector):
                     if vca_deployment_info.get("model") and vca_deployment_info.get(
                         "application"
                     ):
-                        measures = self.loop.run_until_complete(
+                        measures = asyncio.run(
                             self.n2vc.get_metrics(
                                 vca_deployment_info["model"],
                                 vca_deployment_info["application"],