alarm_dictionary = uow.alarm_dictionaries.get(dict_id)
if alarm_dictionary:
res_type.alarmDictionary = alarm_dictionary
+ res_type.events.append(events.ResourceTypeChanged(
+ id=res_type.resourceTypeId,
+ notificationEventType=NotificationEventEnum.CREATE,
+ updatetime=stxobj.updatetime))
uow.resource_types.add(res_type)
else:
resourcetype_id = first['resourceTypeId']
"operational", "availability", "administrative",
"boot_device", "rootfs_device", "install_state", "subfunctions",
"clock_synchronization", "max_cpu_mhz_allowed"
- ]
+ ]
filtered = dict(
filter(lambda item: item[0] in selected_keys, content.items()))
extensions = json.dumps(filtered)
description = ";".join([f"{k}:{v}" for k, v in filtered.items()])
resource = Resource(stxobj.id, resourcetype_id, resourcepool_id,
- stxobj.name, parent_id, gAssetId, stxobj.content,
- description, extensions)
+ parent_id, gAssetId, stxobj.content, description,
+ extensions)
resource.createtime = stxobj.createtime
resource.updatetime = stxobj.updatetime
resource.hash = stxobj.hash
+ resource.events.append(events.ResourceChanged(
+ id=stxobj.id,
+ resourcePoolId=resource.resourcePoolId,
+ notificationEventType=NotificationEventEnum.CREATE,
+ updatetime=stxobj.updatetime
+ ))
+
return resource