Updates for Python 3.10 and Ubuntu 22.04
[osm/POL.git] / osm_policy_module / core / agent.py
index 2daebde..696f69c 100644 (file)
@@ -48,19 +48,16 @@ ALLOWED_KAFKA_KEYS = [
 
 
 class PolicyModuleAgent:
-    def __init__(self, config: Config, loop=None):
+    def __init__(self, config: Config):
         self.conf = config
-        if not loop:
-            loop = asyncio.get_event_loop()
-        self.loop = loop
         self.msg_bus = MessageBusClient(config)
         self.db_client = CommonDbClient(config)
-        self.autoscaling_service = AutoscalingService(config, loop)
-        self.alarming_service = AlarmingService(config, loop)
-        self.healing_service = HealingService(config, loop)
+        self.autoscaling_service = AutoscalingService(config)
+        self.alarming_service = AlarmingService(config)
+        self.healing_service = HealingService(config)
 
     def run(self):
-        self.loop.run_until_complete(self.start())
+        asyncio.run(self.start())
 
     async def start(self):
         Path("/tmp/osm_pol_agent_health_flag").touch()