plugin identity: disco identity is now added in identity metadata:

rel 447
This commit is contained in:
Goffi 2024-07-29 03:30:53 +02:00
commit 6a4133b32c

View file

@ -733,7 +733,8 @@ class Identity:
should be True most of time, to avoid useless network requests
@return: identity data
"""
id_data = {}
identities = []
id_data = {"identities": identities}
if not metadata_filter:
metadata_names = self.metadata.keys()
@ -745,6 +746,15 @@ class Identity:
client, metadata_name, entity, use_cache
)
if entity is not None:
try:
disco_infos = await self.host.memory.disco.get_infos(client, entity)
except Exception as e:
log.exception(f"Can't get disco infos for {entity}.")
else:
for (category, type_), name in disco_infos.identities.items():
identities.append({"category": category, "type": type_, "name": name})
return id_data
def _get_identities(self, entities_s, metadata_filter, profile):