X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_policy_module%2Fcore%2Fagent.py;h=34b852aed996f4816446c8c8c9da2a0b8f8a4b6e;hb=1a0af1c6928ce7269d25ab10be8aac6c21f69d8b;hp=350f383af86df8c4b22d4438c651a128032fbcf1;hpb=e4a298c1336f45b6f799301beffba1234c26267f;p=osm%2FPOL.git diff --git a/osm_policy_module/core/agent.py b/osm_policy_module/core/agent.py index 350f383..34b852a 100644 --- a/osm_policy_module/core/agent.py +++ b/osm_policy_module/core/agent.py @@ -28,6 +28,7 @@ import peewee from osm_policy_module.alarming.service import AlarmingService from osm_policy_module.autoscaling.service import AutoscalingService +from osm_policy_module.common.common_db_client import CommonDbClient from osm_policy_module.common.message_bus_client import MessageBusClient from osm_policy_module.core.config import Config @@ -43,6 +44,7 @@ class PolicyModuleAgent: 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) @@ -91,7 +93,7 @@ class PolicyModuleAgent: async def _handle_instantiated(self, content): log.debug("_handle_instantiated: %s", content) nslcmop_id = content['nslcmop_id'] - nslcmop = self.autoscaling_service.get_nslcmop(nslcmop_id) + nslcmop = self.db_client.get_nslcmop(nslcmop_id) if nslcmop['operationState'] == 'COMPLETED' or nslcmop['operationState'] == 'PARTIALLY_COMPLETED': nsr_id = nslcmop['nsInstanceId'] log.info("Configuring nsr_id: %s", nsr_id) @@ -106,7 +108,7 @@ class PolicyModuleAgent: async def _handle_scaled(self, content): log.debug("_handle_scaled: %s", content) nslcmop_id = content['nslcmop_id'] - nslcmop = self.autoscaling_service.get_nslcmop(nslcmop_id) + nslcmop = self.db_client.get_nslcmop(nslcmop_id) if nslcmop['operationState'] == 'COMPLETED' or nslcmop['operationState'] == 'PARTIALLY_COMPLETED': nsr_id = nslcmop['nsInstanceId'] log.info("Configuring scaled service with nsr_id: %s", nsr_id)