Code Review
/
pti
/
o2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix INF-371 inventoryChange notification of the resourceType, resourcePool, Dms
[pti/o2.git]
/
o2ims
/
service
/
auditor
/
dms_handler.py
diff --git
a/o2ims/service/auditor/dms_handler.py
b/o2ims/service/auditor/dms_handler.py
index
89811c6
..
070c929
100644
(file)
--- a/
o2ims/service/auditor/dms_handler.py
+++ b/
o2ims/service/auditor/dms_handler.py
@@
-14,15
+14,12
@@
# pylint: disable=unused-argument
from __future__ import annotations
# pylint: disable=unused-argument
from __future__ import annotations
-
import base64
import json
import base64
import json
+from o2ims.domain import commands, events
from o2ims.domain.stx_object import StxGenericModel
from o2ims.domain.stx_object import StxGenericModel
-# from dataclasses import asdict
-# from typing import List, Dict, Callable, Type
-# TYPE_CHECKING
-from o2ims.domain import commands
+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.service.unit_of_work import AbstractUnitOfWork
from o2ims.domain.resource_type import MismatchedModel
from o2ims.domain.ocloud import DeploymentManager
@@
-94,6
+91,12
@@
def create_by(stxobj: StxGenericModel, parentid: str) -> DeploymentManager:
localmodel.updatetime = stxobj.updatetime
localmodel.hash = stxobj.hash
localmodel.updatetime = stxobj.updatetime
localmodel.hash = stxobj.hash
+ localmodel.events.append(events.DmsChanged(
+ id=stxobj.id,
+ notificationEventType=NotificationEventEnum.CREATE,
+ updatetime=stxobj.updatetime
+ ))
+
return localmodel
return localmodel
@@
-108,7
+111,12
@@
def update_by(target: DeploymentManager, stxobj: StxGenericModel,
target.oCloudId = parentid
target.version_number = target.version_number + 1
target.profile = _convert_content(stxobj.content)
target.oCloudId = parentid
target.version_number = target.version_number + 1
target.profile = _convert_content(stxobj.content)
- target.events = []
+
+ target.events.append(events.DmsChanged(
+ id=stxobj.id,
+ notificationEventType=NotificationEventEnum.MODIFY,
+ updatetime=stxobj.updatetime
+ ))
def _convert_content(stxobj_content: str):
def _convert_content(stxobj_content: str):