diff --git a/grimoire_elk/enriched/enrich.py b/grimoire_elk/enriched/enrich.py index f309f5635..29663bfec 100644 --- a/grimoire_elk/enriched/enrich.py +++ b/grimoire_elk/enriched/enrich.py @@ -826,13 +826,16 @@ def get_sh_item_from_identity_cache(self, identity_tuple, backend_name): email=iden['email'], name=iden['name'], username=iden['username']) + iden['uuid'] = identity_id + iden['id'] = identity_id + iden['enrollments'] = [] try: individual = self.get_entity(identity_id) if not individual: msg = "Individual not found given the following identity: {}".format(identity_id) logger.debug(msg) - return sh_item + return iden for indv_identity in individual['identities']: if indv_identity['uuid'] == identity_id: @@ -1054,7 +1057,6 @@ def get_item_sh(self, item, roles=None, date_field=None): sh_fields = self.get_item_sh_fields(identity, item_date, rol=rol) else: sh_fields = self.get_item_no_sh_fields(identity, rol) - eitem_sh.update(sh_fields) if not eitem_sh[rol + '_org_name']: diff --git a/releases/unreleased/avoid-'---undefined---'-values.yml b/releases/unreleased/avoid-'---undefined---'-values.yml new file mode 100644 index 000000000..f21d391c3 --- /dev/null +++ b/releases/unreleased/avoid-'---undefined---'-values.yml @@ -0,0 +1,10 @@ +--- +title: Avoid '-- UNDEFINED --' values +category: fixed +author: Quan Zhou +issue: null +notes: > + Avoid `-- UNDEFINED --` values for all SortingHat fields when + Mordred loses connection to the SortingHat server during the + enrichment or autorefresh execution. It will keep the values + ​of the `name`, `email`, `id` and `uuid` fields.