From bde5d75f2a24f709c0295fc4bf513b662cc4ff89 Mon Sep 17 00:00:00 2001 From: "Zhang Rong(Jon)" Date: Tue, 17 Jan 2023 15:54:02 +0800 Subject: [PATCH] Fix INF-393 serviceUri in the DMS list query and detail query have different response Issue-ID: INF-393 Signed-off-by: Zhang Rong(Jon) Change-Id: I5a25412dfdb7b9c8e52157dda4c5627eb329eaec --- o2ims/service/auditor/dms_handler.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/o2ims/service/auditor/dms_handler.py b/o2ims/service/auditor/dms_handler.py index 070c929..f7d5405 100644 --- a/o2ims/service/auditor/dms_handler.py +++ b/o2ims/service/auditor/dms_handler.py @@ -23,7 +23,6 @@ from o2ims.domain.subscription_obj import NotificationEventEnum from o2common.service.unit_of_work import AbstractUnitOfWork from o2ims.domain.resource_type import MismatchedModel from o2ims.domain.ocloud import DeploymentManager -from o2common.config import config # if TYPE_CHECKING: # from . import unit_of_work @@ -76,14 +75,14 @@ def is_outdated(ocloud: DeploymentManager, stxobj: StxGenericModel): def create_by(stxobj: StxGenericModel, parentid: str) -> DeploymentManager: - dmsendpoint = config.get_api_url() +\ - config.get_o2dms_api_base() + "/" + stxobj.id description = "A DMS" ocloudid = parentid supportedLocations = '' capabilities = '' capacity = '' - profile = _convert_content(stxobj.content) + content = json.loads(stxobj.content) + dmsendpoint = content['cluster_api_endpoint'] + profile = _convert_content(content) localmodel = DeploymentManager( stxobj.id, stxobj.name, ocloudid, dmsendpoint, description, supportedLocations, capabilities, capacity, profile) @@ -119,9 +118,9 @@ def update_by(target: DeploymentManager, stxobj: StxGenericModel, )) -def _convert_content(stxobj_content: str): +def _convert_content(content: str): # Convert api retrun content to dict object - content = json.loads(stxobj_content) + # content = json.loads(stxobj_content) admin_user = content["admin_user"] cluster_api_endpoint = content["cluster_api_endpoint"] cluster_ca_cert = _b64_encode_str(content["cluster_ca_cert"]) -- 2.16.6