X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2ims%2Fdomain%2Focloud.py;h=b7c82b58a0accef37d5cb1ffd71b2efa160e23b8;hb=9489d7877a6a9a3c8557fd294591ac59db1561de;hp=a2047afe35a69d9606d2d7dfd7394f6fae0b49bf;hpb=4f9eafd85b51688708f6bf24e9334c532a331d8f;p=pti%2Fo2.git diff --git a/o2ims/domain/ocloud.py b/o2ims/domain/ocloud.py index a2047af..b7c82b5 100644 --- a/o2ims/domain/ocloud.py +++ b/o2ims/domain/ocloud.py @@ -16,15 +16,14 @@ from __future__ import annotations import json from o2common.domain.base import AgRoot, Serializer -from o2common.config import conf as CONF +from o2common.config import config, conf as CONF # from dataclasses import dataclass # from datetime import date # from typing import Optional, List, Set from .resource_type import ResourceKindEnum, ResourceTypeEnum -# from uuid import UUID -DeploymentManagerProfileDefault = 'default' +DeploymentManagerProfileDefault = 'native_k8sapi' DeploymentManagerProfileSOL018 = 'sol018' DeploymentManagerProfileSOL018HelmCLI = 'sol018_helmcli' @@ -55,9 +54,13 @@ class DeploymentManager(AgRoot, Serializer): d['profile'] = json.loads(d['profile']) d['profileSupportList'] = [ DeploymentManagerProfileDefault, - DeploymentManagerProfileSOL018, - DeploymentManagerProfileSOL018HelmCLI, ] + profiles = config.get_dms_support_profiles() + for profile in profiles: + if profile == DeploymentManagerProfileSOL018: + d['profileSupportList'].append(profile) + elif profile == DeploymentManagerProfileSOL018HelmCLI: + d['profileSupportList'].append(profile) return d @@ -102,8 +105,10 @@ class ResourceType(AgRoot, Serializer): def serialize(self): d = Serializer.serialize(self) - d["alarmDictionary"] = CONF.alarm_dictionaries.get( - d['name']).serialize() + if CONF.alarm_dictionaries.get(d['name']) is not None: + d["alarmDictionary"] = CONF.alarm_dictionaries.get( + d['name']).serialize() + return d @@ -111,7 +116,7 @@ class Resource(AgRoot, Serializer): def __init__(self, resourceId: str, resourceTypeId: str, resourcePoolId: str, name: str, parentId: str = '', gAssetId: str = '', elements: str = '', - description: str = '') -> None: + description: str = '', extensions: str = '') -> None: super().__init__() self.resourceId = resourceId self.description = description @@ -119,7 +124,7 @@ class Resource(AgRoot, Serializer): self.globalAssetId = gAssetId self.resourcePoolId = resourcePoolId self.elements = elements - self.extensions = [] + self.extensions = extensions self.name = name self.parentId = parentId