X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2ims%2Fservice%2Fauditor%2Fresourcepool_handler.py;h=1fb24580f2800bf3405f1531689bba04df639884;hb=a61ed1b8e541d52c03bbe540963f6a8e1473e46c;hp=b5b0e0d5a6d3304dc5b661f13817e2e23d49415f;hpb=9625c5b766377f641d9641471f10dd491a61447f;p=pti%2Fo2.git diff --git a/o2ims/service/auditor/resourcepool_handler.py b/o2ims/service/auditor/resourcepool_handler.py index b5b0e0d..1fb2458 100644 --- a/o2ims/service/auditor/resourcepool_handler.py +++ b/o2ims/service/auditor/resourcepool_handler.py @@ -75,11 +75,12 @@ def is_outdated(resourcepool: ResourcePool, stxobj: StxGenericModel): def create_by(stxobj: StxGenericModel, parentid: str) -> ResourcePool: content = json.loads(stxobj.content) - globalcloudId = stxobj.id # to be updated + globalLocationId = '' # to be updated description = "A Resource Pool" + location = content['location'] if content['location'] is not None else '' resourcepool = ResourcePool(stxobj.id, stxobj.name, - content['location'], - parentid, globalcloudId, description) + location, + parentid, globalLocationId, description) resourcepool.createtime = stxobj.createtime resourcepool.updatetime = stxobj.updatetime resourcepool.hash = stxobj.hash @@ -93,7 +94,8 @@ def update_by(target: ResourcePool, stxobj: StxGenericModel, raise MismatchedModel("Mismatched Id") content = json.loads(stxobj.content) target.name = stxobj.name - target.location = content['location'] + target.location = content['location'] if content['location'] is not None \ + else '' target.createtime = stxobj.createtime target.updatetime = stxobj.updatetime target.hash = stxobj.hash