X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2ims%2Fservice%2Fauditor%2Fresourcepool_handler.py;h=366b77fe68e5f6e9768eeaa680d638ae4e9c095c;hb=8d6c2f135ee103b9a94ea6c29986a608069b6982;hp=b5b0e0d5a6d3304dc5b661f13817e2e23d49415f;hpb=b37a7d8e36bd9fdf862cb1aad29f9a29052e725f;p=pti%2Fo2.git diff --git a/o2ims/service/auditor/resourcepool_handler.py b/o2ims/service/auditor/resourcepool_handler.py index b5b0e0d..366b77f 100644 --- a/o2ims/service/auditor/resourcepool_handler.py +++ b/o2ims/service/auditor/resourcepool_handler.py @@ -75,15 +75,20 @@ 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 - + resourcepool.events.append(events.ResourcePoolChanged( + id=stxobj.id, + notificationEventType=NotificationEventEnum.CREATE, + updatetime=stxobj.updatetime + )) return resourcepool @@ -93,7 +98,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