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
Add capabilities of the DMS query
[pti/o2.git]
/
o2ims
/
service
/
auditor
/
resourcepool_handler.py
diff --git
a/o2ims/service/auditor/resourcepool_handler.py
b/o2ims/service/auditor/resourcepool_handler.py
index
b5b0e0d
..
fd5ea8a
100644
(file)
--- 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)
def create_by(stxobj: StxGenericModel, parentid: str) -> ResourcePool:
content = json.loads(stxobj.content)
- global
cloudId = stxobj.id
# to be updated
+ global
LocationId = ''
# to be updated
description = "A Resource Pool"
description = "A Resource Pool"
+ location = content['location'] if content['location'] is not None else ''
resourcepool = ResourcePool(stxobj.id, stxobj.name,
resourcepool = ResourcePool(stxobj.id, stxobj.name,
-
content['location']
,
- parentid, global
cloud
Id, description)
+
location
,
+ parentid, global
Location
Id, description)
resourcepool.createtime = stxobj.createtime
resourcepool.updatetime = stxobj.updatetime
resourcepool.hash = stxobj.hash
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
return resourcepool
@@
-93,11
+98,12
@@
def update_by(target: ResourcePool, stxobj: StxGenericModel,
raise MismatchedModel("Mismatched Id")
content = json.loads(stxobj.content)
target.name = stxobj.name
raise MismatchedModel("Mismatched Id")
content = json.loads(stxobj.content)
target.name = stxobj.name
- target.location = content['location']
- target.createtime = stxobj.createtime
+ target.location = content['location']
if content['location'] is not None \
+ else ''
target.updatetime = stxobj.updatetime
target.updatetime = stxobj.updatetime
- target.hash = stxobj.hash
target.oCloudId = parentid
target.oCloudId = parentid
+
+ target.hash = stxobj.hash
target.version_number = target.version_number + 1
target.events.append(events.ResourcePoolChanged(
id=stxobj.id,
target.version_number = target.version_number + 1
target.events.append(events.ResourcePoolChanged(
id=stxobj.id,